// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate gtype;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Encoding of an input element such as an audio, video, or text track.
/// Elementary streams must be packaged before mapping and sharing between
/// different output formats.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ElementaryStream {
    /// A unique key for this elementary stream. The key must be 1-63
    /// characters in length. The key must begin and end with a letter (regardless
    /// of case) or a number, but can contain dashes or underscores in between.
    pub key: std::string::String,

    /// Required. Encoding of an audio, video, or text track.
    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ElementaryStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::ElementaryStream::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
    ///
    /// Note that all the setters affecting `elementary_stream` are mutually
    /// exclusive.
    pub fn set_elementary_stream<
        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = v.into();
        self
    }

    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// if it holds a `VideoStream`, `None` if the field is not set or
    /// holds a different branch.
    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
        #[allow(unreachable_patterns)]
        self.elementary_stream.as_ref().and_then(|v| match v {
            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// to hold a `VideoStream`.
    ///
    /// Note that all the setters affecting `elementary_stream` are
    /// mutually exclusive.
    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = std::option::Option::Some(
            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
        );
        self
    }

    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// if it holds a `AudioStream`, `None` if the field is not set or
    /// holds a different branch.
    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
        #[allow(unreachable_patterns)]
        self.elementary_stream.as_ref().and_then(|v| match v {
            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// to hold a `AudioStream`.
    ///
    /// Note that all the setters affecting `elementary_stream` are
    /// mutually exclusive.
    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = std::option::Option::Some(
            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
        );
        self
    }

    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// if it holds a `TextStream`, `None` if the field is not set or
    /// holds a different branch.
    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
        #[allow(unreachable_patterns)]
        self.elementary_stream.as_ref().and_then(|v| match v {
            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// to hold a `TextStream`.
    ///
    /// Note that all the setters affecting `elementary_stream` are
    /// mutually exclusive.
    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = std::option::Option::Some(
            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
        );
        self
    }
}

impl wkt::message::Message for ElementaryStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ElementaryStream"
    }
}

/// Defines additional types related to [ElementaryStream].
pub mod elementary_stream {
    #[allow(unused_imports)]
    use super::*;

    /// Required. Encoding of an audio, video, or text track.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ElementaryStream {
        /// Encoding of a video stream.
        VideoStream(std::boxed::Box<crate::model::VideoStream>),
        /// Encoding of an audio stream.
        AudioStream(std::boxed::Box<crate::model::AudioStream>),
        /// Encoding of a text stream. For example, closed captions or subtitles.
        TextStream(std::boxed::Box<crate::model::TextStream>),
    }
}

/// Multiplexing settings for output stream.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MuxStream {
    /// A unique key for this multiplexed stream. The key must be 1-63
    /// characters in length. The key must begin and end with a letter (regardless
    /// of case) or a number, but can contain dashes or underscores in between.
    pub key: std::string::String,

    /// The container format. The default is `fmp4`.
    ///
    /// Supported container formats:
    ///
    /// - `fmp4` - the corresponding file extension is `.m4s`
    /// - `ts` - the corresponding file extension is `.ts`
    pub container: std::string::String,

    /// List of `ElementaryStream`
    /// [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed
    /// in this stream.
    ///
    /// - For `fmp4` container, must contain either one video or one audio stream.
    /// - For `ts` container, must contain exactly one audio stream and up to one
    ///   video stream.
    ///
    /// [google.cloud.video.livestream.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
    pub elementary_streams: std::vec::Vec<std::string::String>,

    /// Segment settings for `fmp4` and `ts`.
    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,

    /// Identifier of the encryption configuration to use. If omitted, output
    /// will be unencrypted.
    pub encryption_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MuxStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::MuxStream::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [container][crate::model::MuxStream::container].
    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.container = v.into();
        self
    }

    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
    pub fn set_segment_settings<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SegmentSettings>,
    {
        self.segment_settings = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SegmentSettings>,
    {
        self.segment_settings = v.map(|x| x.into());
        self
    }

    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.encryption_id = v.into();
        self
    }
}

impl wkt::message::Message for MuxStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.MuxStream"
    }
}

/// Manifest configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Manifest {
    /// The name of the generated file. The default is `manifest` with the
    /// extension suffix corresponding to the `Manifest`
    /// [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple
    /// manifests are added to the channel, each must have a unique file name.
    ///
    /// [google.cloud.video.livestream.v1.Manifest.type]: crate::model::Manifest::type
    pub file_name: std::string::String,

    /// Required. Type of the manifest, can be `HLS` or `DASH`.
    pub r#type: crate::model::manifest::ManifestType,

    /// Required. List of `MuxStream`
    /// [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear
    /// in this manifest.
    ///
    /// - For HLS, either `fmp4` or `ts` mux streams can be specified but not
    ///   mixed.
    /// - For DASH, only `fmp4` mux streams can be specified.
    ///
    /// [google.cloud.video.livestream.v1.MuxStream.key]: crate::model::MuxStream::key
    pub mux_streams: std::vec::Vec<std::string::String>,

    /// Maximum number of segments that this manifest holds. Once the manifest
    /// reaches this maximum number of segments, whenever a new segment is added to
    /// the manifest, the oldest segment will be removed from the manifest.
    /// The minimum value is 3 and the default value is 5.
    pub max_segment_count: i32,

    /// How long to keep a segment on the output Google Cloud Storage bucket after
    /// it is removed from the manifest. This field should be large enough to cover
    /// the manifest propagation delay. Otherwise, a player could receive 404
    /// errors while accessing segments which are listed in the manifest that the
    /// player has, but were already deleted from the output Google Cloud Storage
    /// bucket. Default value is `60s`.
    ///
    /// If both segment_keep_duration and
    /// [RetentionConfig.retention_window_duration][google.cloud.video.livestream.v1.RetentionConfig.retention_window_duration]
    /// are set,
    /// [RetentionConfig.retention_window_duration][google.cloud.video.livestream.v1.RetentionConfig.retention_window_duration]
    /// is used and segment_keep_duration is ignored.
    ///
    /// [google.cloud.video.livestream.v1.RetentionConfig.retention_window_duration]: crate::model::RetentionConfig::retention_window_duration
    pub segment_keep_duration: std::option::Option<wkt::Duration>,

    /// Whether to use the timecode, as specified in timecode config, when setting:
    ///
    /// - `availabilityStartTime` attribute in DASH manifests.
    /// - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests.
    ///
    /// If false, ignore the input timecode and use the time from system clock
    /// when the manifest is first generated. This is the default behavior.
    pub use_timecode_as_timeline: bool,

    /// Optional. A unique key for this manifest.
    pub key: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Manifest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [file_name][crate::model::Manifest::file_name].
    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.file_name = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::Manifest::type].
    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [max_segment_count][crate::model::Manifest::max_segment_count].
    pub fn set_max_segment_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.max_segment_count = v.into();
        self
    }

    /// Sets the value of [segment_keep_duration][crate::model::Manifest::segment_keep_duration].
    pub fn set_segment_keep_duration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.segment_keep_duration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [segment_keep_duration][crate::model::Manifest::segment_keep_duration].
    pub fn set_or_clear_segment_keep_duration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.segment_keep_duration = v.map(|x| x.into());
        self
    }

    /// Sets the value of [use_timecode_as_timeline][crate::model::Manifest::use_timecode_as_timeline].
    pub fn set_use_timecode_as_timeline<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.use_timecode_as_timeline = v.into();
        self
    }

    /// Sets the value of [key][crate::model::Manifest::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }
}

impl wkt::message::Message for Manifest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Manifest"
    }
}

/// Defines additional types related to [Manifest].
pub mod manifest {
    #[allow(unused_imports)]
    use super::*;

    /// The manifest type can be either `HLS` or `DASH`.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ManifestType {
        /// The manifest type is not specified.
        Unspecified,
        /// Create an `HLS` manifest. The corresponding file extension is `.m3u8`.
        Hls,
        /// Create a `DASH` manifest. The corresponding file extension is `.mpd`.
        Dash,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ManifestType::value] or
        /// [ManifestType::name].
        UnknownValue(manifest_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod manifest_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ManifestType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Hls => std::option::Option::Some(1),
                Self::Dash => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
                Self::Hls => std::option::Option::Some("HLS"),
                Self::Dash => std::option::Option::Some("DASH"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ManifestType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ManifestType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ManifestType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Hls,
                2 => Self::Dash,
                _ => Self::UnknownValue(manifest_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ManifestType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
                "HLS" => Self::Hls,
                "DASH" => Self::Dash,
                _ => Self::UnknownValue(manifest_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ManifestType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Hls => serializer.serialize_i32(1),
                Self::Dash => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ManifestType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
                ".google.cloud.video.livestream.v1.Manifest.ManifestType",
            ))
        }
    }
}

/// Multiplexing settings for output streams used in
/// [Distribution][google.cloud.video.livestream.v1.Distribution].
///
/// [google.cloud.video.livestream.v1.Distribution]: crate::model::Distribution
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DistributionStream {
    /// Required. A unique key for this distribution stream. The key must be 1-63
    /// characters in length. The key must begin and end with a letter (regardless
    /// of case) or a number, but can contain dashes or underscores in between.
    pub key: std::string::String,

    /// Required. The container format.
    ///
    /// Supported container formats:
    ///
    /// - `ts`, must contain exactly one audio stream and up to one video stream.
    /// - `flv`, must contain at most one audio stream and at most one video
    ///   stream.
    pub container: std::string::String,

    /// Required. List of `ElementaryStream`
    /// [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed
    /// in this stream. Must contain at least one audio stream and up to one video
    /// stream.
    ///
    /// [google.cloud.video.livestream.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
    pub elementary_streams: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DistributionStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::DistributionStream::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [container][crate::model::DistributionStream::container].
    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.container = v.into();
        self
    }

    /// Sets the value of [elementary_streams][crate::model::DistributionStream::elementary_streams].
    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for DistributionStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DistributionStream"
    }
}

/// Distribution configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Distribution {
    /// Required. A unique key for this distribution. The key must be 1-63
    /// characters in length. The key must begin and end with a letter (regardless
    /// of case) or a number, but can contain dashes or underscores in between.
    pub key: std::string::String,

    /// Required. `DistributionStream`
    /// [key][google.cloud.video.livestream.v1.DistributionStream.key]s that should
    /// appear in this distribution output.
    ///
    /// - For SRT protocol, only `ts` distribution streams can be specified.
    /// - For RTMP protocol, only `flv` distribution streams can be specified.
    ///
    /// [google.cloud.video.livestream.v1.DistributionStream.key]: crate::model::DistributionStream::key
    pub distribution_stream: std::string::String,

    /// Output only. State of the distribution.
    pub state: crate::model::distribution::State,

    /// Output only. Only present when the `state` is `ERROR`. The reason for the
    /// error state of the distribution.
    pub error: std::option::Option<rpc::model::Status>,

    /// Configurations for the output endpoint by streaming protocols.
    pub endpoint: std::option::Option<crate::model::distribution::Endpoint>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Distribution {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::Distribution::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [distribution_stream][crate::model::Distribution::distribution_stream].
    pub fn set_distribution_stream<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.distribution_stream = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Distribution::state].
    pub fn set_state<T: std::convert::Into<crate::model::distribution::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [error][crate::model::Distribution::error].
    pub fn set_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error][crate::model::Distribution::error].
    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [endpoint][crate::model::Distribution::endpoint].
    ///
    /// Note that all the setters affecting `endpoint` are mutually
    /// exclusive.
    pub fn set_endpoint<
        T: std::convert::Into<std::option::Option<crate::model::distribution::Endpoint>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.endpoint = v.into();
        self
    }

    /// The value of [endpoint][crate::model::Distribution::endpoint]
    /// if it holds a `SrtPush`, `None` if the field is not set or
    /// holds a different branch.
    pub fn srt_push(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::SrtPushOutputEndpoint>> {
        #[allow(unreachable_patterns)]
        self.endpoint.as_ref().and_then(|v| match v {
            crate::model::distribution::Endpoint::SrtPush(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [endpoint][crate::model::Distribution::endpoint]
    /// to hold a `SrtPush`.
    ///
    /// Note that all the setters affecting `endpoint` are
    /// mutually exclusive.
    pub fn set_srt_push<
        T: std::convert::Into<std::boxed::Box<crate::model::SrtPushOutputEndpoint>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.endpoint =
            std::option::Option::Some(crate::model::distribution::Endpoint::SrtPush(v.into()));
        self
    }

    /// The value of [endpoint][crate::model::Distribution::endpoint]
    /// if it holds a `RtmpPush`, `None` if the field is not set or
    /// holds a different branch.
    pub fn rtmp_push(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::RtmpPushOutputEndpoint>> {
        #[allow(unreachable_patterns)]
        self.endpoint.as_ref().and_then(|v| match v {
            crate::model::distribution::Endpoint::RtmpPush(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [endpoint][crate::model::Distribution::endpoint]
    /// to hold a `RtmpPush`.
    ///
    /// Note that all the setters affecting `endpoint` are
    /// mutually exclusive.
    pub fn set_rtmp_push<
        T: std::convert::Into<std::boxed::Box<crate::model::RtmpPushOutputEndpoint>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.endpoint =
            std::option::Option::Some(crate::model::distribution::Endpoint::RtmpPush(v.into()));
        self
    }
}

impl wkt::message::Message for Distribution {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Distribution"
    }
}

/// Defines additional types related to [Distribution].
pub mod distribution {
    #[allow(unused_imports)]
    use super::*;

    /// State of this distribution.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is not specified.
        Unspecified,
        /// Distribution has trouble to produce or deliver the output.
        Error,
        /// Distribution is not ready to be started.
        NotReady,
        /// Distribution is ready to be started.
        Ready,
        /// Distribution is already started and is waiting for input.
        AwaitingInput,
        /// Distribution is already started and is generating output.
        Distributing,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Error => std::option::Option::Some(5),
                Self::NotReady => std::option::Option::Some(6),
                Self::Ready => std::option::Option::Some(7),
                Self::AwaitingInput => std::option::Option::Some(8),
                Self::Distributing => std::option::Option::Some(9),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::NotReady => std::option::Option::Some("NOT_READY"),
                Self::Ready => std::option::Option::Some("READY"),
                Self::AwaitingInput => std::option::Option::Some("AWAITING_INPUT"),
                Self::Distributing => std::option::Option::Some("DISTRIBUTING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                5 => Self::Error,
                6 => Self::NotReady,
                7 => Self::Ready,
                8 => Self::AwaitingInput,
                9 => Self::Distributing,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "ERROR" => Self::Error,
                "NOT_READY" => Self::NotReady,
                "READY" => Self::Ready,
                "AWAITING_INPUT" => Self::AwaitingInput,
                "DISTRIBUTING" => Self::Distributing,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Error => serializer.serialize_i32(5),
                Self::NotReady => serializer.serialize_i32(6),
                Self::Ready => serializer.serialize_i32(7),
                Self::AwaitingInput => serializer.serialize_i32(8),
                Self::Distributing => serializer.serialize_i32(9),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.video.livestream.v1.Distribution.State",
            ))
        }
    }

    /// Configurations for the output endpoint by streaming protocols.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Endpoint {
        /// Output endpoint using SRT_PUSH.
        SrtPush(std::boxed::Box<crate::model::SrtPushOutputEndpoint>),
        /// Output endpoint using RTMP_PUSH.
        RtmpPush(std::boxed::Box<crate::model::RtmpPushOutputEndpoint>),
    }
}

/// Configurations for an output endpoint using SRT_PUSH as the streaming
/// protocol.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SrtPushOutputEndpoint {
    /// Required. The full URI of the remote SRT server.
    pub uri: std::string::String,

    /// Defines where SRT encryption passphrase are stored.
    pub passphrase_source:
        std::option::Option<crate::model::srt_push_output_endpoint::PassphraseSource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SrtPushOutputEndpoint {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::SrtPushOutputEndpoint::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [passphrase_source][crate::model::SrtPushOutputEndpoint::passphrase_source].
    ///
    /// Note that all the setters affecting `passphrase_source` are mutually
    /// exclusive.
    pub fn set_passphrase_source<
        T: std::convert::Into<
                std::option::Option<crate::model::srt_push_output_endpoint::PassphraseSource>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.passphrase_source = v.into();
        self
    }

    /// The value of [passphrase_source][crate::model::SrtPushOutputEndpoint::passphrase_source]
    /// if it holds a `PassphraseSecretVersion`, `None` if the field is not set or
    /// holds a different branch.
    pub fn passphrase_secret_version(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.passphrase_source.as_ref().and_then(|v| match v {
            crate::model::srt_push_output_endpoint::PassphraseSource::PassphraseSecretVersion(
                v,
            ) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [passphrase_source][crate::model::SrtPushOutputEndpoint::passphrase_source]
    /// to hold a `PassphraseSecretVersion`.
    ///
    /// Note that all the setters affecting `passphrase_source` are
    /// mutually exclusive.
    pub fn set_passphrase_secret_version<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.passphrase_source = std::option::Option::Some(
            crate::model::srt_push_output_endpoint::PassphraseSource::PassphraseSecretVersion(
                v.into(),
            ),
        );
        self
    }
}

impl wkt::message::Message for SrtPushOutputEndpoint {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.SrtPushOutputEndpoint"
    }
}

/// Defines additional types related to [SrtPushOutputEndpoint].
pub mod srt_push_output_endpoint {
    #[allow(unused_imports)]
    use super::*;

    /// Defines where SRT encryption passphrase are stored.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum PassphraseSource {
        /// The name of the Secret Version containing the SRT encryption passphrase,
        /// which is stored in Google Secret Manager. It should be in the format of
        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`.
        PassphraseSecretVersion(std::string::String),
    }
}

/// Configurations for an output endpoint using RTMP_PUSH as the streaming
/// protocol.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RtmpPushOutputEndpoint {
    /// Required. The full URI of the remote RTMP server. For example:
    /// `rtmp://192.168.123.321/live/my-stream` or `rtmp://somedomain.com/someapp`.
    pub uri: std::string::String,

    /// Required. Stream key for RTMP protocol.
    pub stream_key: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RtmpPushOutputEndpoint {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::RtmpPushOutputEndpoint::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [stream_key][crate::model::RtmpPushOutputEndpoint::stream_key].
    pub fn set_stream_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.stream_key = v.into();
        self
    }
}

impl wkt::message::Message for RtmpPushOutputEndpoint {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.RtmpPushOutputEndpoint"
    }
}

/// Sprite sheet configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpriteSheet {
    /// Format type. The default is `jpeg`.
    ///
    /// Supported formats:
    ///
    /// - `jpeg`
    pub format: std::string::String,

    /// Required. File name prefix for the generated sprite sheets. If multiple
    /// sprite sheets are added to the channel, each must have a unique file
    /// prefix.
    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
    pub file_prefix: std::string::String,

    /// Required. The width of the sprite in pixels. Must be an even integer.
    pub sprite_width_pixels: i32,

    /// Required. The height of the sprite in pixels. Must be an even integer.
    pub sprite_height_pixels: i32,

    /// The maximum number of sprites per row in a sprite sheet. Valid range is
    /// [1, 10] and the default value is 1.
    pub column_count: i32,

    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
    /// a new sprite sheet is created. Valid range is [1, 10] and the default value
    /// is 1.
    pub row_count: i32,

    /// Create sprites at regular intervals. Valid range is [1 second, 1 hour] and
    /// the default value is `10s`.
    pub interval: std::option::Option<wkt::Duration>,

    /// The quality of the generated sprite sheet. Enter a value between 1
    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
    /// The default is 100. A high quality value corresponds to a low image data
    /// compression ratio.
    pub quality: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SpriteSheet {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [format][crate::model::SpriteSheet::format].
    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.format = v.into();
        self
    }

    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.file_prefix = v.into();
        self
    }

    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.sprite_width_pixels = v.into();
        self
    }

    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.sprite_height_pixels = v.into();
        self
    }

    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.column_count = v.into();
        self
    }

    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.row_count = v.into();
        self
    }

    /// Sets the value of [interval][crate::model::SpriteSheet::interval].
    pub fn set_interval<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.interval = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [interval][crate::model::SpriteSheet::interval].
    pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.interval = v.map(|x| x.into());
        self
    }

    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.quality = v.into();
        self
    }
}

impl wkt::message::Message for SpriteSheet {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.SpriteSheet"
    }
}

/// Preprocessing configurations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreprocessingConfig {
    /// Audio preprocessing configuration.
    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,

    /// Specify the video cropping configuration.
    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,

    /// Specify the video pad filter configuration.
    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PreprocessingConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
    pub fn set_audio<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
    {
        self.audio = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
    {
        self.audio = v.map(|x| x.into());
        self
    }

    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
    pub fn set_crop<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
    {
        self.crop = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
    {
        self.crop = v.map(|x| x.into());
        self
    }

    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
    pub fn set_pad<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
    {
        self.pad = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
    {
        self.pad = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for PreprocessingConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.PreprocessingConfig"
    }
}

/// Defines additional types related to [PreprocessingConfig].
pub mod preprocessing_config {
    #[allow(unused_imports)]
    use super::*;

    /// Audio preprocessing configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Audio {
        /// Specify audio loudness normalization in loudness units relative to full
        /// scale (LUFS). Enter a value between -24 and 0 according to the following:
        ///
        /// - -24 is the Advanced Television Systems Committee (ATSC A/85)
        /// - -23 is the EU R128 broadcast standard
        /// - -19 is the prior standard for online mono audio
        /// - -18 is the ReplayGain standard
        /// - -16 is the prior standard for stereo audio
        /// - -14 is the new online audio standard recommended by Spotify, as well as
        ///   Amazon Echo
        /// - 0 disables normalization. The default is 0.
        pub lufs: f64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Audio {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.lufs = v.into();
            self
        }
    }

    impl wkt::message::Message for Audio {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.PreprocessingConfig.Audio"
        }
    }

    /// Video cropping configuration for the input video. The cropped input video
    /// is scaled to match the output resolution.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Crop {
        /// The number of pixels to crop from the top. The default is 0.
        pub top_pixels: i32,

        /// The number of pixels to crop from the bottom. The default is 0.
        pub bottom_pixels: i32,

        /// The number of pixels to crop from the left. The default is 0.
        pub left_pixels: i32,

        /// The number of pixels to crop from the right. The default is 0.
        pub right_pixels: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Crop {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.top_pixels = v.into();
            self
        }

        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bottom_pixels = v.into();
            self
        }

        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.left_pixels = v.into();
            self
        }

        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.right_pixels = v.into();
            self
        }
    }

    impl wkt::message::Message for Crop {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.PreprocessingConfig.Crop"
        }
    }

    /// Pad filter configuration for the input video. The padded input video
    /// is scaled after padding with black to match the output resolution.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Pad {
        /// The number of pixels to add to the top. The default is 0.
        pub top_pixels: i32,

        /// The number of pixels to add to the bottom. The default is 0.
        pub bottom_pixels: i32,

        /// The number of pixels to add to the left. The default is 0.
        pub left_pixels: i32,

        /// The number of pixels to add to the right. The default is 0.
        pub right_pixels: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Pad {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.top_pixels = v.into();
            self
        }

        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bottom_pixels = v.into();
            self
        }

        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.left_pixels = v.into();
            self
        }

        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.right_pixels = v.into();
            self
        }
    }

    impl wkt::message::Message for Pad {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.PreprocessingConfig.Pad"
        }
    }
}

/// Video stream resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoStream {
    /// Codec settings.
    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
    ///
    /// Note that all the setters affecting `codec_settings` are mutually
    /// exclusive.
    pub fn set_codec_settings<
        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings = v.into();
        self
    }

    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// if it holds a `H264`, `None` if the field is not set or
    /// holds a different branch.
    pub fn h264(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
        #[allow(unreachable_patterns)]
        self.codec_settings.as_ref().and_then(|v| match v {
            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// to hold a `H264`.
    ///
    /// Note that all the setters affecting `codec_settings` are
    /// mutually exclusive.
    pub fn set_h264<
        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings =
            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
        self
    }

    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// if it holds a `H265`, `None` if the field is not set or
    /// holds a different branch.
    pub fn h265(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
        #[allow(unreachable_patterns)]
        self.codec_settings.as_ref().and_then(|v| match v {
            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// to hold a `H265`.
    ///
    /// Note that all the setters affecting `codec_settings` are
    /// mutually exclusive.
    pub fn set_h265<
        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings =
            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
        self
    }
}

impl wkt::message::Message for VideoStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.VideoStream"
    }
}

/// Defines additional types related to [VideoStream].
pub mod video_stream {
    #[allow(unused_imports)]
    use super::*;

    /// H264 codec settings.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H264CodecSettings {
        /// Required. The width of the video in pixels. Must be an even integer.
        /// Valid range is [320, 4096].
        pub width_pixels: i32,

        /// Required. The height of the video in pixels. Must be an even integer.
        /// Valid range is [180, 2160].
        pub height_pixels: i32,

        /// Required. The target video frame rate in frames per second (FPS). Must be
        /// less than or equal to 60. Will default to the input frame rate if larger
        /// than the input frame rate. The API will generate an output FPS that is
        /// divisible by the input FPS, and smaller or equal to the target FPS. See
        /// [Calculating frame
        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for
        /// more information.
        pub frame_rate: f64,

        /// Required. The video bitrate in bits per second. Minimum value is 10,000.
        ///
        /// - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps).
        /// - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps).
        /// - For UHD resolution (<= 2160p), must be <= 25,000,000 (25 Mbps).
        pub bitrate_bps: i32,

        /// Specifies whether an open Group of Pictures (GOP) structure should be
        /// allowed or not. The default is `false`.
        pub allow_open_gop: bool,

        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
        /// greater than zero. The default is equal to
        /// [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps].
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
        pub vbv_size_bits: i32,

        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
        /// Must be greater than zero. The default is equal to 90% of
        /// [vbv_size_bits][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits].
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
        pub vbv_fullness_bits: i32,

        /// The entropy coder to use. The default is `cabac`.
        ///
        /// Supported entropy coders:
        ///
        /// - `cavlc`
        /// - `cabac`
        pub entropy_coder: std::string::String,

        /// Allow B-pyramid for reference frame selection. This may not be supported
        /// on all decoders. The default is `false`.
        pub b_pyramid: bool,

        /// The number of consecutive B-frames. Must be greater than or equal to
        /// zero. Must be less than
        /// [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count]
        /// if set. The default is 0.
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
        pub b_frame_count: i32,

        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
        /// higher value equals a lower bitrate but smoother image. The default is 0.
        pub aq_strength: f64,

        /// Enforces the specified codec profile. The following profiles are
        /// supported:
        ///
        /// * `baseline`
        /// * `main` (default)
        /// * `high`
        ///
        /// The available options are [FFmpeg-compatible Profile
        /// Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the
        /// [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
        /// message.
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]: crate::model::video_stream::H264CodecSettings
        pub profile: std::string::String,

        /// Enforces the specified codec tune. The available options are
        /// [FFmpeg-compatible Encode
        /// Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune)
        /// Note that certain values for this field may cause the transcoder to
        /// override other fields you set in the
        /// [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
        /// message.
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]: crate::model::video_stream::H264CodecSettings
        pub tune: std::string::String,

        /// GOP mode can be either by frame count or duration.
        pub gop_mode:
            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H264CodecSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.width_pixels = v.into();
            self
        }

        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.height_pixels = v.into();
            self
        }

        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.frame_rate = v.into();
            self
        }

        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bitrate_bps = v.into();
            self
        }

        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.allow_open_gop = v.into();
            self
        }

        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_size_bits = v.into();
            self
        }

        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_fullness_bits = v.into();
            self
        }

        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.entropy_coder = v.into();
            self
        }

        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.b_pyramid = v.into();
            self
        }

        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.b_frame_count = v.into();
            self
        }

        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.aq_strength = v.into();
            self
        }

        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.profile = v.into();
            self
        }

        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.tune = v.into();
            self
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
        ///
        /// Note that all the setters affecting `gop_mode` are mutually
        /// exclusive.
        pub fn set_gop_mode<
            T: std::convert::Into<
                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = v.into();
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// if it holds a `GopFrameCount`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// to hold a `GopFrameCount`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
            );
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// if it holds a `GopDuration`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// to hold a `GopDuration`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for H264CodecSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.VideoStream.H264CodecSettings"
        }
    }

    /// Defines additional types related to [H264CodecSettings].
    pub mod h_264_codec_settings {
        #[allow(unused_imports)]
        use super::*;

        /// GOP mode can be either by frame count or duration.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum GopMode {
            /// Select the GOP size based on the specified frame count.
            /// If GOP frame count is set instead of GOP duration, GOP duration will be
            /// calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration
            /// must satisfy the limitations on `gopDuration` as well.
            /// Valid range is [60, 600].
            GopFrameCount(i32),
            /// Select the GOP size based on the specified duration. The default is
            /// `2s`. Note that `gopDuration` must be less than or equal to
            /// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration],
            /// and
            /// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration]
            /// must be divisible by `gopDuration`. Valid range is [2s, 20s].
            ///
            /// All video streams in the same channel must have the same GOP size.
            ///
            /// [google.cloud.video.livestream.v1.SegmentSettings.segment_duration]: crate::model::SegmentSettings::segment_duration
            GopDuration(std::boxed::Box<wkt::Duration>),
        }
    }

    /// H265 codec settings.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H265CodecSettings {
        /// Optional. The width of the video in pixels. Must be an even integer.
        /// When not specified, the width is adjusted to match the specified height
        /// and input aspect ratio. If both are omitted, the input width is used.
        /// Valid range is [320, 4096].
        pub width_pixels: i32,

        /// Optional. The height of the video in pixels. Must be an even integer.
        /// When not specified, the height is adjusted to match the specified width
        /// and input aspect ratio. If both are omitted, the input height is used.
        /// Valid range is [180, 2160].
        pub height_pixels: i32,

        /// Required. The target video frame rate in frames per second (FPS). Must be
        /// less than or equal to 120. Will default to the input frame rate if larger
        /// than the input frame rate. The API will generate an output FPS that is
        /// divisible by the input FPS, and smaller or equal to the target FPS. See
        /// [Calculating frame
        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for
        /// more information.
        pub frame_rate: f64,

        /// Required. The video bitrate in bits per second. Minimum value is 10,000.
        ///
        /// - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps).
        /// - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps).
        /// - For UHD resolution (<= 2160p), must be <= 25,000,000 (25 Mbps).
        pub bitrate_bps: i32,

        /// Optional. Size of the Video Buffering Verifier (VBV) buffer in bits. Must
        /// be greater than zero. The default is equal to
        /// [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H265CodecSettings.bitrate_bps].
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H265CodecSettings.bitrate_bps]: crate::model::video_stream::H265CodecSettings::bitrate_bps
        pub vbv_size_bits: i32,

        /// Optional. Initial fullness of the Video Buffering Verifier (VBV) buffer
        /// in bits. Must be greater than zero. The default is equal to 90% of
        /// [vbv_size_bits][google.cloud.video.livestream.v1.VideoStream.H265CodecSettings.vbv_size_bits].
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
        pub vbv_fullness_bits: i32,

        /// Optional. Allow B-pyramid for reference frame selection. This may not be
        /// supported on all decoders. The default is `false`.
        pub b_pyramid: bool,

        /// Optional. The number of consecutive B-frames. Must be greater than or
        /// equal to zero. Must be less than
        /// [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H265CodecSettings.gop_frame_count]
        /// if set. The default is 0.
        ///
        /// [google.cloud.video.livestream.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
        pub b_frame_count: i32,

        /// Optional. Specify the intensity of the adaptive quantizer (AQ). Must be
        /// between 0 and 1, where 0 disables the quantizer and 1 maximizes the
        /// quantizer. A higher value equals a lower bitrate but smoother image. The
        /// default is 0.
        pub aq_strength: f64,

        /// GOP mode can be either by frame count or duration.
        pub gop_mode:
            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H265CodecSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.width_pixels = v.into();
            self
        }

        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.height_pixels = v.into();
            self
        }

        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.frame_rate = v.into();
            self
        }

        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bitrate_bps = v.into();
            self
        }

        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_size_bits = v.into();
            self
        }

        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_fullness_bits = v.into();
            self
        }

        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.b_pyramid = v.into();
            self
        }

        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.b_frame_count = v.into();
            self
        }

        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.aq_strength = v.into();
            self
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
        ///
        /// Note that all the setters affecting `gop_mode` are mutually
        /// exclusive.
        pub fn set_gop_mode<
            T: std::convert::Into<
                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = v.into();
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// if it holds a `GopFrameCount`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// to hold a `GopFrameCount`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
            );
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// if it holds a `GopDuration`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// to hold a `GopDuration`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for H265CodecSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.VideoStream.H265CodecSettings"
        }
    }

    /// Defines additional types related to [H265CodecSettings].
    pub mod h_265_codec_settings {
        #[allow(unused_imports)]
        use super::*;

        /// GOP mode can be either by frame count or duration.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum GopMode {
            /// Optional. Select the GOP size based on the specified frame count.
            /// If GOP frame count is set instead of GOP duration, GOP duration will be
            /// calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration
            /// must satisfy the limitations on `gopDuration` as well.
            /// Valid range is [60, 600].
            GopFrameCount(i32),
            /// Optional. Select the GOP size based on the specified duration. The
            /// default is `2s`. Note that `gopDuration` must be less than or equal to
            /// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration],
            /// and
            /// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration]
            /// must be divisible by `gopDuration`. Valid range is [2s, 20s].
            ///
            /// All video streams in the same channel must have the same GOP size.
            ///
            /// [google.cloud.video.livestream.v1.SegmentSettings.segment_duration]: crate::model::SegmentSettings::segment_duration
            GopDuration(std::boxed::Box<wkt::Duration>),
        }
    }

    /// Codec settings.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CodecSettings {
        /// H264 codec settings.
        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
        /// H265 codec settings.
        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
    }
}

/// Audio stream resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AudioStream {
    /// Specifies whether pass through (transmuxing) is enabled or not.
    /// If set to `true`, the rest of the settings, other than `mapping`, will be
    /// ignored. The default is `false`.
    pub transmux: bool,

    /// The codec for this audio stream. The default is `aac`.
    ///
    /// Supported audio codecs:
    ///
    /// - `aac`
    pub codec: std::string::String,

    /// Required. Audio bitrate in bits per second. Must be between 1 and
    /// 10,000,000.
    pub bitrate_bps: i32,

    /// Number of audio channels. Must be between 1 and 6. The default is 2.
    pub channel_count: i32,

    /// A list of channel names specifying layout of the audio channels.
    /// This only affects the metadata embedded in the container headers, if
    /// supported by the specified format. The default is `[fl, fr]`.
    ///
    /// Supported channel names:
    ///
    /// - `fl` - Front left channel
    /// - `fr` - Front right channel
    /// - `sl` - Side left channel
    /// - `sr` - Side right channel
    /// - `fc` - Front center channel
    /// - `lfe` - Low frequency
    pub channel_layout: std::vec::Vec<std::string::String>,

    /// The mapping for the input streams and audio channels.
    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,

    /// The audio sample rate in Hertz. The default is 48000 Hertz.
    pub sample_rate_hertz: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AudioStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [transmux][crate::model::AudioStream::transmux].
    pub fn set_transmux<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.transmux = v.into();
        self
    }

    /// Sets the value of [codec][crate::model::AudioStream::codec].
    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.codec = v.into();
        self
    }

    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.bitrate_bps = v.into();
        self
    }

    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.channel_count = v.into();
        self
    }

    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
    pub fn set_mapping<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
    {
        use std::iter::Iterator;
        self.mapping = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.sample_rate_hertz = v.into();
        self
    }
}

impl wkt::message::Message for AudioStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.AudioStream"
    }
}

/// Defines additional types related to [AudioStream].
pub mod audio_stream {
    #[allow(unused_imports)]
    use super::*;

    /// The mapping for the input streams and audio channels.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AudioMapping {
        /// Required. The `Channel`
        /// [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]
        /// that identifies the input that this audio mapping applies to. If an
        /// active input doesn't have an audio mapping, the primary audio track in
        /// the input stream will be selected.
        ///
        /// [google.cloud.video.livestream.v1.InputAttachment.key]: crate::model::InputAttachment::key
        pub input_key: std::string::String,

        /// Required. The zero-based index of the track in the input stream.
        /// All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in
        /// the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must
        /// have the same input track.
        ///
        /// [google.cloud.video.livestream.v1.AudioStream]: crate::model::AudioStream
        /// [google.cloud.video.livestream.v1.AudioStream.mapping]: crate::model::AudioStream::mapping
        pub input_track: i32,

        /// Required. The zero-based index of the channel in the input stream.
        pub input_channel: i32,

        /// Required. The zero-based index of the channel in the output audio stream.
        /// Must be consistent with the
        /// [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel].
        ///
        /// [google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]: crate::model::audio_stream::AudioMapping::input_channel
        pub output_channel: i32,

        /// Audio volume control in dB. Negative values decrease volume,
        /// positive values increase. The default is 0.
        pub gain_db: f64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AudioMapping {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.input_key = v.into();
            self
        }

        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.input_track = v.into();
            self
        }

        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.input_channel = v.into();
            self
        }

        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.output_channel = v.into();
            self
        }

        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.gain_db = v.into();
            self
        }
    }

    impl wkt::message::Message for AudioMapping {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.AudioStream.AudioMapping"
        }
    }
}

/// Encoding of a text stream. For example, closed captions or subtitles.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextStream {
    /// Required. The codec for this text stream.
    ///
    /// Supported text codecs:
    ///
    /// - `cea608`
    /// - `cea708`
    /// - `webvtt`
    pub codec: std::string::String,

    /// Optional. The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
    /// information, see
    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
    pub language_code: std::string::String,

    /// Optional. The name for this particular text stream that will be added to
    /// the HLS/DASH manifest.
    pub display_name: std::string::String,

    /// Optional. The channel of the closed caption in the output stream.
    /// This field should only be set when textstream is used for partner
    /// distribution.
    /// Must be one of `CC1`, `CC2`, `CC3`, and `CC4`, if the
    /// [codec][google.cloud.video.livestream.v1.TextStream.codec] is `cea608`;
    /// Must be one between `SERVICE1` and `SERVICE63`, if the
    /// [codec][google.cloud.video.livestream.v1.TextStream.codec] is `cea708`.
    ///
    /// [google.cloud.video.livestream.v1.TextStream.codec]: crate::model::TextStream::codec
    pub output_cea_channel: std::string::String,

    /// Optional. The mapping for the input streams and text tracks.
    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TextStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec][crate::model::TextStream::codec].
    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.codec = v.into();
        self
    }

    /// Sets the value of [language_code][crate::model::TextStream::language_code].
    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.language_code = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::TextStream::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [output_cea_channel][crate::model::TextStream::output_cea_channel].
    pub fn set_output_cea_channel<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.output_cea_channel = v.into();
        self
    }

    /// Sets the value of [mapping][crate::model::TextStream::mapping].
    pub fn set_mapping<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::text_stream::TextMapping>,
    {
        use std::iter::Iterator;
        self.mapping = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for TextStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.TextStream"
    }
}

/// Defines additional types related to [TextStream].
pub mod text_stream {
    #[allow(unused_imports)]
    use super::*;

    /// The mapping for the input streams and text tracks.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct TextMapping {
        /// Optional. The `Channel`
        /// [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]
        /// that identifies the input that this text mapping applies to.
        ///
        /// [google.cloud.video.livestream.v1.InputAttachment.key]: crate::model::InputAttachment::key
        pub input_key: std::string::String,

        /// Optional. The zero-based index of the track in the input stream.
        pub input_track: i32,

        /// Optional. The channel of the closed caption in the input stream.
        /// If this field is set, the output
        /// [codec][google.cloud.video.livestream.v1.TextStream.codec] must be
        /// `webvtt`. Must be one of `CC1`, `CC2`, `CC3`, and `CC4`, if the codec of
        /// the input closed caption is `cea608`; Must be one between `SERVICE1` and
        /// `SERVICE64`, if the codec of the input closed caption is `cea708`.
        ///
        /// [google.cloud.video.livestream.v1.TextStream.codec]: crate::model::TextStream::codec
        pub input_cea_channel: std::string::String,

        /// Optional. The BCP-47 source language code, such as `en-US` or `sr-Latn`.
        /// If differ from the textStream's language code, enable translation. For
        /// more information on BCP-47 language codes, see
        /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
        pub from_language_code: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl TextMapping {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.input_key = v.into();
            self
        }

        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.input_track = v.into();
            self
        }

        /// Sets the value of [input_cea_channel][crate::model::text_stream::TextMapping::input_cea_channel].
        pub fn set_input_cea_channel<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.input_cea_channel = v.into();
            self
        }

        /// Sets the value of [from_language_code][crate::model::text_stream::TextMapping::from_language_code].
        pub fn set_from_language_code<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.from_language_code = v.into();
            self
        }
    }

    impl wkt::message::Message for TextMapping {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.TextStream.TextMapping"
        }
    }
}

/// Segment settings for `fmp4` and `ts`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SegmentSettings {
    /// Duration of the segments in seconds. The default is `6s`. Note that
    /// `segmentDuration` must be greater than or equal to
    /// [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration],
    /// and `segmentDuration` must be divisible by
    /// [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration].
    /// Valid range is [2s, 20s].
    ///
    /// All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in
    /// the same manifest must have the same segment duration.
    ///
    /// [google.cloud.video.livestream.v1.Manifest.mux_streams]: crate::model::Manifest::mux_streams
    /// [google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]: crate::model::video_stream::H264CodecSettings::gop_mode
    pub segment_duration: std::option::Option<wkt::Duration>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SegmentSettings {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
    pub fn set_segment_duration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.segment_duration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.segment_duration = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for SegmentSettings {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.SegmentSettings"
    }
}

/// Timecode configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimecodeConfig {
    /// The source of the timecode that will later be used in outputs/manifests.
    /// It determines the initial timecode/timestamp (first frame) of output
    /// streams.
    pub source: crate::model::timecode_config::TimecodeSource,

    /// For EMBEDDED_TIMECODE source only.
    /// Used to interpret the embedded timecode (which contains only the time part
    /// and no date). We assume all inputs are live.
    pub time_offset: std::option::Option<crate::model::timecode_config::TimeOffset>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TimecodeConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [source][crate::model::TimecodeConfig::source].
    pub fn set_source<T: std::convert::Into<crate::model::timecode_config::TimecodeSource>>(
        mut self,
        v: T,
    ) -> Self {
        self.source = v.into();
        self
    }

    /// Sets the value of [time_offset][crate::model::TimecodeConfig::time_offset].
    ///
    /// Note that all the setters affecting `time_offset` are mutually
    /// exclusive.
    pub fn set_time_offset<
        T: std::convert::Into<std::option::Option<crate::model::timecode_config::TimeOffset>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.time_offset = v.into();
        self
    }

    /// The value of [time_offset][crate::model::TimecodeConfig::time_offset]
    /// if it holds a `UtcOffset`, `None` if the field is not set or
    /// holds a different branch.
    pub fn utc_offset(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
        #[allow(unreachable_patterns)]
        self.time_offset.as_ref().and_then(|v| match v {
            crate::model::timecode_config::TimeOffset::UtcOffset(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [time_offset][crate::model::TimecodeConfig::time_offset]
    /// to hold a `UtcOffset`.
    ///
    /// Note that all the setters affecting `time_offset` are
    /// mutually exclusive.
    pub fn set_utc_offset<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_offset = std::option::Option::Some(
            crate::model::timecode_config::TimeOffset::UtcOffset(v.into()),
        );
        self
    }

    /// The value of [time_offset][crate::model::TimecodeConfig::time_offset]
    /// if it holds a `TimeZone`, `None` if the field is not set or
    /// holds a different branch.
    pub fn time_zone(&self) -> std::option::Option<&std::boxed::Box<gtype::model::TimeZone>> {
        #[allow(unreachable_patterns)]
        self.time_offset.as_ref().and_then(|v| match v {
            crate::model::timecode_config::TimeOffset::TimeZone(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [time_offset][crate::model::TimecodeConfig::time_offset]
    /// to hold a `TimeZone`.
    ///
    /// Note that all the setters affecting `time_offset` are
    /// mutually exclusive.
    pub fn set_time_zone<T: std::convert::Into<std::boxed::Box<gtype::model::TimeZone>>>(
        mut self,
        v: T,
    ) -> Self {
        self.time_offset = std::option::Option::Some(
            crate::model::timecode_config::TimeOffset::TimeZone(v.into()),
        );
        self
    }
}

impl wkt::message::Message for TimecodeConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.TimecodeConfig"
    }
}

/// Defines additional types related to [TimecodeConfig].
pub mod timecode_config {
    #[allow(unused_imports)]
    use super::*;

    /// The source of timecode.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum TimecodeSource {
        /// The timecode source is not specified.
        Unspecified,
        /// Use input media timestamp.
        MediaTimestamp,
        /// Use input embedded timecode e.g. picture timing SEI message.
        EmbeddedTimecode,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [TimecodeSource::value] or
        /// [TimecodeSource::name].
        UnknownValue(timecode_source::UnknownValue),
    }

    #[doc(hidden)]
    pub mod timecode_source {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl TimecodeSource {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::MediaTimestamp => std::option::Option::Some(1),
                Self::EmbeddedTimecode => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TIMECODE_SOURCE_UNSPECIFIED"),
                Self::MediaTimestamp => std::option::Option::Some("MEDIA_TIMESTAMP"),
                Self::EmbeddedTimecode => std::option::Option::Some("EMBEDDED_TIMECODE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for TimecodeSource {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for TimecodeSource {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for TimecodeSource {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::MediaTimestamp,
                2 => Self::EmbeddedTimecode,
                _ => Self::UnknownValue(timecode_source::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for TimecodeSource {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TIMECODE_SOURCE_UNSPECIFIED" => Self::Unspecified,
                "MEDIA_TIMESTAMP" => Self::MediaTimestamp,
                "EMBEDDED_TIMECODE" => Self::EmbeddedTimecode,
                _ => Self::UnknownValue(timecode_source::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for TimecodeSource {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::MediaTimestamp => serializer.serialize_i32(1),
                Self::EmbeddedTimecode => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for TimecodeSource {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimecodeSource>::new(
                ".google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource",
            ))
        }
    }

    /// For EMBEDDED_TIMECODE source only.
    /// Used to interpret the embedded timecode (which contains only the time part
    /// and no date). We assume all inputs are live.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum TimeOffset {
        /// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
        UtcOffset(std::boxed::Box<wkt::Duration>),
        /// Time zone e.g. "America/Los_Angeles".
        TimeZone(std::boxed::Box<gtype::model::TimeZone>),
    }
}

/// Input resource represents the endpoint from which the channel ingests
/// the input stream.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Input {
    /// The resource name of the input, in the form of:
    /// `projects/{project}/locations/{location}/inputs/{inputId}`.
    pub name: std::string::String,

    /// Output only. The creation time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined key/value metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Source type.
    pub r#type: crate::model::input::Type,

    /// Tier defines the maximum input specification that is accepted by the
    /// video pipeline. The billing is charged based on the tier specified here.
    /// See [Pricing](https://cloud.google.com/livestream/pricing) for more detail.
    /// The default is `HD`.
    pub tier: crate::model::input::Tier,

    /// Output only. URI to push the input stream to.
    /// Its format depends on the input
    /// [type][google.cloud.video.livestream.v1.Input.type], for example:
    ///
    /// * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}`
    /// * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}`
    ///
    /// [google.cloud.video.livestream.v1.Input.type]: crate::model::Input::type
    pub uri: std::string::String,

    /// Preprocessing configurations.
    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,

    /// Security rule for access control.
    pub security_rules: std::option::Option<crate::model::input::SecurityRule>,

    /// Output only. The information for the input stream. This field will be
    /// present only when this input receives the input stream.
    pub input_stream_property: std::option::Option<crate::model::InputStreamProperty>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Input {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Input::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Input::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Input::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Input::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Input::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Input::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [r#type][crate::model::Input::type].
    pub fn set_type<T: std::convert::Into<crate::model::input::Type>>(mut self, v: T) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [tier][crate::model::Input::tier].
    pub fn set_tier<T: std::convert::Into<crate::model::input::Tier>>(mut self, v: T) -> Self {
        self.tier = v.into();
        self
    }

    /// Sets the value of [uri][crate::model::Input::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PreprocessingConfig>,
    {
        self.preprocessing_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PreprocessingConfig>,
    {
        self.preprocessing_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [security_rules][crate::model::Input::security_rules].
    pub fn set_security_rules<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::input::SecurityRule>,
    {
        self.security_rules = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [security_rules][crate::model::Input::security_rules].
    pub fn set_or_clear_security_rules<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::input::SecurityRule>,
    {
        self.security_rules = v.map(|x| x.into());
        self
    }

    /// Sets the value of [input_stream_property][crate::model::Input::input_stream_property].
    pub fn set_input_stream_property<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InputStreamProperty>,
    {
        self.input_stream_property = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [input_stream_property][crate::model::Input::input_stream_property].
    pub fn set_or_clear_input_stream_property<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InputStreamProperty>,
    {
        self.input_stream_property = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Input {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Input"
    }
}

/// Defines additional types related to [Input].
pub mod input {
    #[allow(unused_imports)]
    use super::*;

    /// Security rules for access control. Each field represents one security rule.
    /// Only when the source of the input stream satisfies all the fields, this
    /// input stream can be accepted.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SecurityRule {
        /// At least one ip range must match unless none specified. The IP range is
        /// defined by CIDR block: for example, `192.0.1.0/24` for a range and
        /// `192.0.1.0/32` for a single IP address.
        pub ip_ranges: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SecurityRule {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [ip_ranges][crate::model::input::SecurityRule::ip_ranges].
        pub fn set_ip_ranges<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.ip_ranges = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for SecurityRule {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Input.SecurityRule"
        }
    }

    /// The type of the input.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Input type is not specified.
        Unspecified,
        /// Input will take an rtmp input stream.
        RtmpPush,
        /// Input will take an srt (Secure Reliable Transport) input stream.
        SrtPush,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::RtmpPush => std::option::Option::Some(1),
                Self::SrtPush => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::RtmpPush => std::option::Option::Some("RTMP_PUSH"),
                Self::SrtPush => std::option::Option::Some("SRT_PUSH"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::RtmpPush,
                2 => Self::SrtPush,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "RTMP_PUSH" => Self::RtmpPush,
                "SRT_PUSH" => Self::SrtPush,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::RtmpPush => serializer.serialize_i32(1),
                Self::SrtPush => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.video.livestream.v1.Input.Type",
            ))
        }
    }

    /// Tier of the input specification.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Tier {
        /// Tier is not specified.
        Unspecified,
        /// Resolution < 1280x720. Bitrate <= 6 Mbps. FPS <= 60.
        Sd,
        /// Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60.
        Hd,
        /// Resolution <= 4096x2160. Bitrate <= 50 Mbps. FPS <= 60.
        Uhd,
        /// Resolution <= 1280x720. Bitrate <= 6 Mbps. FPS <= 60. H265 codec.
        SdH265,
        /// Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. H265 codec.
        HdH265,
        /// Resolution <= 4096x2160. Bitrate <= 50 Mbps. FPS <= 60. H265 codec.
        UhdH265,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Tier::value] or
        /// [Tier::name].
        UnknownValue(tier::UnknownValue),
    }

    #[doc(hidden)]
    pub mod tier {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Tier {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Sd => std::option::Option::Some(1),
                Self::Hd => std::option::Option::Some(2),
                Self::Uhd => std::option::Option::Some(3),
                Self::SdH265 => std::option::Option::Some(4),
                Self::HdH265 => std::option::Option::Some(5),
                Self::UhdH265 => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
                Self::Sd => std::option::Option::Some("SD"),
                Self::Hd => std::option::Option::Some("HD"),
                Self::Uhd => std::option::Option::Some("UHD"),
                Self::SdH265 => std::option::Option::Some("SD_H265"),
                Self::HdH265 => std::option::Option::Some("HD_H265"),
                Self::UhdH265 => std::option::Option::Some("UHD_H265"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Tier {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Tier {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Tier {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Sd,
                2 => Self::Hd,
                3 => Self::Uhd,
                4 => Self::SdH265,
                5 => Self::HdH265,
                6 => Self::UhdH265,
                _ => Self::UnknownValue(tier::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Tier {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TIER_UNSPECIFIED" => Self::Unspecified,
                "SD" => Self::Sd,
                "HD" => Self::Hd,
                "UHD" => Self::Uhd,
                "SD_H265" => Self::SdH265,
                "HD_H265" => Self::HdH265,
                "UHD_H265" => Self::UhdH265,
                _ => Self::UnknownValue(tier::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Tier {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Sd => serializer.serialize_i32(1),
                Self::Hd => serializer.serialize_i32(2),
                Self::Uhd => serializer.serialize_i32(3),
                Self::SdH265 => serializer.serialize_i32(4),
                Self::HdH265 => serializer.serialize_i32(5),
                Self::UhdH265 => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Tier {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
                ".google.cloud.video.livestream.v1.Input.Tier",
            ))
        }
    }
}

/// Channel resource represents the processor that does a user-defined
/// "streaming" operation, which includes getting an input stream through an
/// input, transcoding it to multiple renditions, and publishing output live
/// streams in certain formats (for example, HLS or DASH) to the specified
/// location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Channel {
    /// The resource name of the channel, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    /// Output only. The creation time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined key/value metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// A list of input attachments that this channel uses.
    /// One channel can have multiple inputs as the input sources. Only one
    /// input can be selected as the input source at one time.
    pub input_attachments: std::vec::Vec<crate::model::InputAttachment>,

    /// Output only. The
    /// [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]
    /// that serves as the current input source. The first input in the
    /// [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]
    /// is the initial input source.
    ///
    /// [google.cloud.video.livestream.v1.Channel.input_attachments]: crate::model::Channel::input_attachments
    /// [google.cloud.video.livestream.v1.InputAttachment.key]: crate::model::InputAttachment::key
    pub active_input: std::string::String,

    /// Required. Information about the output (that is, the Cloud Storage bucket
    /// to store the generated live stream).
    pub output: std::option::Option<crate::model::channel::Output>,

    /// List of elementary streams.
    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,

    /// List of multiplexing settings for output streams.
    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,

    /// List of output manifests.
    pub manifests: std::vec::Vec<crate::model::Manifest>,

    /// Optional. List of multiplexing settings of streams for distributions.
    pub distribution_streams: std::vec::Vec<crate::model::DistributionStream>,

    /// Optional. List of distributions.
    pub distributions: std::vec::Vec<crate::model::Distribution>,

    /// List of output sprite sheets.
    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,

    /// Output only. State of the streaming operation.
    pub streaming_state: crate::model::channel::StreamingState,

    /// Output only. A description of the reason for the streaming error. This
    /// property is always present when
    /// [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state]
    /// is
    /// [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR].
    ///
    /// [google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]: crate::model::channel::StreamingState::StreamingError
    /// [google.cloud.video.livestream.v1.Channel.streaming_state]: crate::model::Channel::streaming_state
    pub streaming_error: std::option::Option<rpc::model::Status>,

    /// Configuration of platform logs for this channel.
    pub log_config: std::option::Option<crate::model::LogConfig>,

    /// Configuration of timecode for this channel.
    pub timecode_config: std::option::Option<crate::model::TimecodeConfig>,

    /// Optional. Encryption configurations for this channel. Each configuration
    /// has an ID which is referred to by each MuxStream to indicate which
    /// configuration is used for that output.
    pub encryptions: std::vec::Vec<crate::model::Encryption>,

    /// The configuration for input sources defined in
    /// [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments].
    ///
    /// [google.cloud.video.livestream.v1.Channel.input_attachments]: crate::model::Channel::input_attachments
    pub input_config: std::option::Option<crate::model::InputConfig>,

    /// Optional. Configuration for retention of output files for this channel.
    pub retention_config: std::option::Option<crate::model::RetentionConfig>,

    /// Optional. List of static overlay images. Those images display over the
    /// output content for the whole duration of the live stream.
    pub static_overlays: std::vec::Vec<crate::model::StaticOverlay>,

    /// Optional. Advanced configurations for auto-generated text streams.
    pub auto_transcription_config: std::option::Option<crate::model::AutoTranscriptionConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Channel {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Channel::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Channel::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Channel::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Channel::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Channel::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Channel::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [input_attachments][crate::model::Channel::input_attachments].
    pub fn set_input_attachments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::InputAttachment>,
    {
        use std::iter::Iterator;
        self.input_attachments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [active_input][crate::model::Channel::active_input].
    pub fn set_active_input<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.active_input = v.into();
        self
    }

    /// Sets the value of [output][crate::model::Channel::output].
    pub fn set_output<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::channel::Output>,
    {
        self.output = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [output][crate::model::Channel::output].
    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::channel::Output>,
    {
        self.output = v.map(|x| x.into());
        self
    }

    /// Sets the value of [elementary_streams][crate::model::Channel::elementary_streams].
    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ElementaryStream>,
    {
        use std::iter::Iterator;
        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [mux_streams][crate::model::Channel::mux_streams].
    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::MuxStream>,
    {
        use std::iter::Iterator;
        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [manifests][crate::model::Channel::manifests].
    pub fn set_manifests<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Manifest>,
    {
        use std::iter::Iterator;
        self.manifests = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [distribution_streams][crate::model::Channel::distribution_streams].
    pub fn set_distribution_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DistributionStream>,
    {
        use std::iter::Iterator;
        self.distribution_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [distributions][crate::model::Channel::distributions].
    pub fn set_distributions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Distribution>,
    {
        use std::iter::Iterator;
        self.distributions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [sprite_sheets][crate::model::Channel::sprite_sheets].
    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SpriteSheet>,
    {
        use std::iter::Iterator;
        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [streaming_state][crate::model::Channel::streaming_state].
    pub fn set_streaming_state<T: std::convert::Into<crate::model::channel::StreamingState>>(
        mut self,
        v: T,
    ) -> Self {
        self.streaming_state = v.into();
        self
    }

    /// Sets the value of [streaming_error][crate::model::Channel::streaming_error].
    pub fn set_streaming_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.streaming_error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [streaming_error][crate::model::Channel::streaming_error].
    pub fn set_or_clear_streaming_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.streaming_error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [log_config][crate::model::Channel::log_config].
    pub fn set_log_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LogConfig>,
    {
        self.log_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [log_config][crate::model::Channel::log_config].
    pub fn set_or_clear_log_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::LogConfig>,
    {
        self.log_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [timecode_config][crate::model::Channel::timecode_config].
    pub fn set_timecode_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::TimecodeConfig>,
    {
        self.timecode_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [timecode_config][crate::model::Channel::timecode_config].
    pub fn set_or_clear_timecode_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::TimecodeConfig>,
    {
        self.timecode_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [encryptions][crate::model::Channel::encryptions].
    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Encryption>,
    {
        use std::iter::Iterator;
        self.encryptions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [input_config][crate::model::Channel::input_config].
    pub fn set_input_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InputConfig>,
    {
        self.input_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [input_config][crate::model::Channel::input_config].
    pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InputConfig>,
    {
        self.input_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [retention_config][crate::model::Channel::retention_config].
    pub fn set_retention_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::RetentionConfig>,
    {
        self.retention_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [retention_config][crate::model::Channel::retention_config].
    pub fn set_or_clear_retention_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::RetentionConfig>,
    {
        self.retention_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [static_overlays][crate::model::Channel::static_overlays].
    pub fn set_static_overlays<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::StaticOverlay>,
    {
        use std::iter::Iterator;
        self.static_overlays = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [auto_transcription_config][crate::model::Channel::auto_transcription_config].
    pub fn set_auto_transcription_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AutoTranscriptionConfig>,
    {
        self.auto_transcription_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [auto_transcription_config][crate::model::Channel::auto_transcription_config].
    pub fn set_or_clear_auto_transcription_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AutoTranscriptionConfig>,
    {
        self.auto_transcription_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Channel {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Channel"
    }
}

/// Defines additional types related to [Channel].
pub mod channel {
    #[allow(unused_imports)]
    use super::*;

    /// Location of output file(s) in a Google Cloud Storage bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Output {
        /// URI for the output file(s). For example, `gs://my-bucket/outputs/`.
        pub uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Output {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [uri][crate::model::channel::Output::uri].
        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.uri = v.into();
            self
        }
    }

    impl wkt::message::Message for Output {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Channel.Output"
        }
    }

    /// State of streaming operation that the channel is running.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum StreamingState {
        /// Streaming state is not specified.
        Unspecified,
        /// Channel is getting the input stream, generating the live streams to the
        /// specified output location.
        Streaming,
        /// Channel is waiting for the input stream through the input.
        AwaitingInput,
        /// Channel is running, but has trouble publishing the live streams onto the
        /// specified output location (for example, the specified Cloud Storage
        /// bucket is not writable).
        StreamingError,
        /// Channel is generating live streams with no input stream. Live streams are
        /// filled out with black screen, while input stream is missing.
        /// Not supported yet.
        StreamingNoInput,
        /// Channel is stopped, finishing live streams.
        Stopped,
        /// Channel is starting.
        Starting,
        /// Channel is stopping.
        Stopping,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [StreamingState::value] or
        /// [StreamingState::name].
        UnknownValue(streaming_state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod streaming_state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl StreamingState {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Streaming => std::option::Option::Some(1),
                Self::AwaitingInput => std::option::Option::Some(2),
                Self::StreamingError => std::option::Option::Some(4),
                Self::StreamingNoInput => std::option::Option::Some(5),
                Self::Stopped => std::option::Option::Some(6),
                Self::Starting => std::option::Option::Some(7),
                Self::Stopping => std::option::Option::Some(8),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STREAMING_STATE_UNSPECIFIED"),
                Self::Streaming => std::option::Option::Some("STREAMING"),
                Self::AwaitingInput => std::option::Option::Some("AWAITING_INPUT"),
                Self::StreamingError => std::option::Option::Some("STREAMING_ERROR"),
                Self::StreamingNoInput => std::option::Option::Some("STREAMING_NO_INPUT"),
                Self::Stopped => std::option::Option::Some("STOPPED"),
                Self::Starting => std::option::Option::Some("STARTING"),
                Self::Stopping => std::option::Option::Some("STOPPING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for StreamingState {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for StreamingState {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for StreamingState {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Streaming,
                2 => Self::AwaitingInput,
                4 => Self::StreamingError,
                5 => Self::StreamingNoInput,
                6 => Self::Stopped,
                7 => Self::Starting,
                8 => Self::Stopping,
                _ => Self::UnknownValue(streaming_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for StreamingState {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STREAMING_STATE_UNSPECIFIED" => Self::Unspecified,
                "STREAMING" => Self::Streaming,
                "AWAITING_INPUT" => Self::AwaitingInput,
                "STREAMING_ERROR" => Self::StreamingError,
                "STREAMING_NO_INPUT" => Self::StreamingNoInput,
                "STOPPED" => Self::Stopped,
                "STARTING" => Self::Starting,
                "STOPPING" => Self::Stopping,
                _ => Self::UnknownValue(streaming_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for StreamingState {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Streaming => serializer.serialize_i32(1),
                Self::AwaitingInput => serializer.serialize_i32(2),
                Self::StreamingError => serializer.serialize_i32(4),
                Self::StreamingNoInput => serializer.serialize_i32(5),
                Self::Stopped => serializer.serialize_i32(6),
                Self::Starting => serializer.serialize_i32(7),
                Self::Stopping => serializer.serialize_i32(8),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for StreamingState {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StreamingState>::new(
                ".google.cloud.video.livestream.v1.Channel.StreamingState",
            ))
        }
    }
}

/// 2D normalized coordinates.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NormalizedCoordinate {
    /// Optional. Normalized x coordinate. Valid range is [0.0, 1.0]. Default is 0.
    pub x: f64,

    /// Optional. Normalized y coordinate. Valid range is [0.0, 1.0]. Default is 0.
    pub y: f64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NormalizedCoordinate {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [x][crate::model::NormalizedCoordinate::x].
    pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.x = v.into();
        self
    }

    /// Sets the value of [y][crate::model::NormalizedCoordinate::y].
    pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.y = v.into();
        self
    }
}

impl wkt::message::Message for NormalizedCoordinate {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.NormalizedCoordinate"
    }
}

/// Normalized resolution.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NormalizedResolution {
    /// Optional. Normalized width. Valid range is [0.0, 1.0]. Default is 0.
    pub w: f64,

    /// Optional. Normalized height. Valid range is [0.0, 1.0]. Default is 0.
    pub h: f64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NormalizedResolution {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [w][crate::model::NormalizedResolution::w].
    pub fn set_w<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.w = v.into();
        self
    }

    /// Sets the value of [h][crate::model::NormalizedResolution::h].
    pub fn set_h<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.h = v.into();
        self
    }
}

impl wkt::message::Message for NormalizedResolution {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.NormalizedResolution"
    }
}

/// Configuration for the static overlay.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StaticOverlay {
    /// Required. Asset to use for the overlaid image.
    /// The asset must be represented in the form of:
    /// `projects/{project}/locations/{location}/assets/{assetId}`.
    /// The asset's resource type must be image.
    pub asset: std::string::String,

    /// Optional. Normalized image resolution, based on output video resolution.
    /// Valid values are [0.0, 1.0]. To respect the original image aspect ratio,
    /// set either `w` or `h` to 0. To use the original image resolution, set both
    /// `w` and `h` to 0. The default is {0, 0}.
    pub resolution: std::option::Option<crate::model::NormalizedResolution>,

    /// Optional. Position of the image in terms of normalized coordinates of the
    /// upper-left corner of the image, based on output video resolution. For
    /// example, use the x and y coordinates {0, 0} to position the top-left corner
    /// of the overlay animation in the top-left corner of the output video.
    pub position: std::option::Option<crate::model::NormalizedCoordinate>,

    /// Optional. Target image opacity. Valid values are from `1.0` (solid,
    /// default) to `0.0` (transparent), exclusive. Set this to a value greater
    /// than `0.0`.
    pub opacity: f64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StaticOverlay {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [asset][crate::model::StaticOverlay::asset].
    pub fn set_asset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.asset = v.into();
        self
    }

    /// Sets the value of [resolution][crate::model::StaticOverlay::resolution].
    pub fn set_resolution<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NormalizedResolution>,
    {
        self.resolution = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resolution][crate::model::StaticOverlay::resolution].
    pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::NormalizedResolution>,
    {
        self.resolution = v.map(|x| x.into());
        self
    }

    /// Sets the value of [position][crate::model::StaticOverlay::position].
    pub fn set_position<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NormalizedCoordinate>,
    {
        self.position = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [position][crate::model::StaticOverlay::position].
    pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::NormalizedCoordinate>,
    {
        self.position = v.map(|x| x.into());
        self
    }

    /// Sets the value of [opacity][crate::model::StaticOverlay::opacity].
    pub fn set_opacity<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.opacity = v.into();
        self
    }
}

impl wkt::message::Message for StaticOverlay {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.StaticOverlay"
    }
}

/// Configuration for the input sources of a channel.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputConfig {
    /// Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`.
    pub input_switch_mode: crate::model::input_config::InputSwitchMode,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InputConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [input_switch_mode][crate::model::InputConfig::input_switch_mode].
    pub fn set_input_switch_mode<
        T: std::convert::Into<crate::model::input_config::InputSwitchMode>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.input_switch_mode = v.into();
        self
    }
}

impl wkt::message::Message for InputConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.InputConfig"
    }
}

/// Defines additional types related to [InputConfig].
pub mod input_config {
    #[allow(unused_imports)]
    use super::*;

    /// Input switch mode.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum InputSwitchMode {
        /// The input switch mode is not specified.
        Unspecified,
        /// Automatic failover is enabled. The primary input stream is always
        /// preferred over its backup input streams configured using the
        /// [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover]
        /// field.
        ///
        /// [google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover]: crate::model::input_attachment::AutomaticFailover
        FailoverPreferPrimary,
        /// Automatic failover is disabled. You must use the
        /// [inputSwitch][google.cloud.video.livestream.v1.Event.input_switch] event
        /// to switch the active input source for the channel to stream from. When
        /// this mode is chosen, the
        /// [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover]
        /// field is ignored.
        ///
        /// [google.cloud.video.livestream.v1.Event.input_switch]: crate::model::Event::task
        /// [google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover]: crate::model::input_attachment::AutomaticFailover
        Manual,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [InputSwitchMode::value] or
        /// [InputSwitchMode::name].
        UnknownValue(input_switch_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod input_switch_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl InputSwitchMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::FailoverPreferPrimary => std::option::Option::Some(1),
                Self::Manual => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("INPUT_SWITCH_MODE_UNSPECIFIED"),
                Self::FailoverPreferPrimary => std::option::Option::Some("FAILOVER_PREFER_PRIMARY"),
                Self::Manual => std::option::Option::Some("MANUAL"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for InputSwitchMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for InputSwitchMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for InputSwitchMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::FailoverPreferPrimary,
                3 => Self::Manual,
                _ => Self::UnknownValue(input_switch_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for InputSwitchMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "INPUT_SWITCH_MODE_UNSPECIFIED" => Self::Unspecified,
                "FAILOVER_PREFER_PRIMARY" => Self::FailoverPreferPrimary,
                "MANUAL" => Self::Manual,
                _ => Self::UnknownValue(input_switch_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for InputSwitchMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::FailoverPreferPrimary => serializer.serialize_i32(1),
                Self::Manual => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for InputSwitchMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<InputSwitchMode>::new(
                ".google.cloud.video.livestream.v1.InputConfig.InputSwitchMode",
            ))
        }
    }
}

/// Configuration of platform logs.
/// See [Using and managing platform
/// logs](https://cloud.google.com/logging/docs/api/platform-logs#managing-logs)
/// for more information about how to view platform logs through Cloud Logging.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogConfig {
    /// The severity level of platform logging for this resource.
    pub log_severity: crate::model::log_config::LogSeverity,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LogConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [log_severity][crate::model::LogConfig::log_severity].
    pub fn set_log_severity<T: std::convert::Into<crate::model::log_config::LogSeverity>>(
        mut self,
        v: T,
    ) -> Self {
        self.log_severity = v.into();
        self
    }
}

impl wkt::message::Message for LogConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.LogConfig"
    }
}

/// Defines additional types related to [LogConfig].
pub mod log_config {
    #[allow(unused_imports)]
    use super::*;

    /// The severity level of platform logging for this channel. Logs with a
    /// severity level higher than or equal to the chosen severity level will be
    /// logged and can be viewed through Cloud Logging.
    /// The severity level of a log is ranked as followed from low to high: DEBUG <
    /// INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY.
    /// See
    /// [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity)
    /// for more information.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum LogSeverity {
        /// Log severity is not specified. This is the same as log severity is OFF.
        Unspecified,
        /// Log is turned off.
        Off,
        /// Log with severity higher than or equal to DEBUG are logged.
        Debug,
        /// Logs with severity higher than or equal to INFO are logged.
        Info,
        /// Logs with severity higher than or equal to WARNING are logged.
        Warning,
        /// Logs with severity higher than or equal to ERROR are logged.
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [LogSeverity::value] or
        /// [LogSeverity::name].
        UnknownValue(log_severity::UnknownValue),
    }

    #[doc(hidden)]
    pub mod log_severity {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl LogSeverity {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Off => std::option::Option::Some(1),
                Self::Debug => std::option::Option::Some(100),
                Self::Info => std::option::Option::Some(200),
                Self::Warning => std::option::Option::Some(400),
                Self::Error => std::option::Option::Some(500),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("LOG_SEVERITY_UNSPECIFIED"),
                Self::Off => std::option::Option::Some("OFF"),
                Self::Debug => std::option::Option::Some("DEBUG"),
                Self::Info => std::option::Option::Some("INFO"),
                Self::Warning => std::option::Option::Some("WARNING"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for LogSeverity {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for LogSeverity {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for LogSeverity {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Off,
                100 => Self::Debug,
                200 => Self::Info,
                400 => Self::Warning,
                500 => Self::Error,
                _ => Self::UnknownValue(log_severity::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for LogSeverity {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "LOG_SEVERITY_UNSPECIFIED" => Self::Unspecified,
                "OFF" => Self::Off,
                "DEBUG" => Self::Debug,
                "INFO" => Self::Info,
                "WARNING" => Self::Warning,
                "ERROR" => Self::Error,
                _ => Self::UnknownValue(log_severity::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for LogSeverity {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Off => serializer.serialize_i32(1),
                Self::Debug => serializer.serialize_i32(100),
                Self::Info => serializer.serialize_i32(200),
                Self::Warning => serializer.serialize_i32(400),
                Self::Error => serializer.serialize_i32(500),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for LogSeverity {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogSeverity>::new(
                ".google.cloud.video.livestream.v1.LogConfig.LogSeverity",
            ))
        }
    }
}

/// Configuration for retention of output files.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetentionConfig {
    /// The minimum duration for which the output files from the channel will
    /// remain in the output bucket. After this duration, output files are
    /// deleted asynchronously.
    ///
    /// When the channel is deleted, all output files are deleted from the output
    /// bucket asynchronously.
    ///
    /// If omitted or set to zero, output files will remain in the output bucket
    /// based on
    /// [Manifest.segment_keep_duration][google.cloud.video.livestream.v1.Manifest.segment_keep_duration],
    /// which defaults to 60s.
    ///
    /// If both retention_window_duration and
    /// [Manifest.segment_keep_duration][google.cloud.video.livestream.v1.Manifest.segment_keep_duration]
    /// are set, retention_window_duration is used and
    /// [Manifest.segment_keep_duration][google.cloud.video.livestream.v1.Manifest.segment_keep_duration]
    /// is ignored.
    ///
    /// [google.cloud.video.livestream.v1.Manifest.segment_keep_duration]: crate::model::Manifest::segment_keep_duration
    pub retention_window_duration: std::option::Option<wkt::Duration>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RetentionConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [retention_window_duration][crate::model::RetentionConfig::retention_window_duration].
    pub fn set_retention_window_duration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.retention_window_duration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [retention_window_duration][crate::model::RetentionConfig::retention_window_duration].
    pub fn set_or_clear_retention_window_duration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.retention_window_duration = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RetentionConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.RetentionConfig"
    }
}

/// Properties of the input stream.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputStreamProperty {
    /// The time that the current input stream is accepted and the connection is
    /// established.
    pub last_establish_time: std::option::Option<wkt::Timestamp>,

    /// Properties of the video streams.
    pub video_streams: std::vec::Vec<crate::model::VideoStreamProperty>,

    /// Properties of the audio streams.
    pub audio_streams: std::vec::Vec<crate::model::AudioStreamProperty>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InputStreamProperty {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [last_establish_time][crate::model::InputStreamProperty::last_establish_time].
    pub fn set_last_establish_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_establish_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [last_establish_time][crate::model::InputStreamProperty::last_establish_time].
    pub fn set_or_clear_last_establish_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_establish_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [video_streams][crate::model::InputStreamProperty::video_streams].
    pub fn set_video_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::VideoStreamProperty>,
    {
        use std::iter::Iterator;
        self.video_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [audio_streams][crate::model::InputStreamProperty::audio_streams].
    pub fn set_audio_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::AudioStreamProperty>,
    {
        use std::iter::Iterator;
        self.audio_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for InputStreamProperty {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.InputStreamProperty"
    }
}

/// Properties of the video stream.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoStreamProperty {
    /// Index of this video stream.
    pub index: i32,

    /// Properties of the video format.
    pub video_format: std::option::Option<crate::model::VideoFormat>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoStreamProperty {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [index][crate::model::VideoStreamProperty::index].
    pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.index = v.into();
        self
    }

    /// Sets the value of [video_format][crate::model::VideoStreamProperty::video_format].
    pub fn set_video_format<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::VideoFormat>,
    {
        self.video_format = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [video_format][crate::model::VideoStreamProperty::video_format].
    pub fn set_or_clear_video_format<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::VideoFormat>,
    {
        self.video_format = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for VideoStreamProperty {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.VideoStreamProperty"
    }
}

/// Properties of the video format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoFormat {
    /// Video codec used in this video stream.
    pub codec: std::string::String,

    /// The width of the video stream in pixels.
    pub width_pixels: i32,

    /// The height of the video stream in pixels.
    pub height_pixels: i32,

    /// The frame rate of the input video stream.
    pub frame_rate: f64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoFormat {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec][crate::model::VideoFormat::codec].
    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.codec = v.into();
        self
    }

    /// Sets the value of [width_pixels][crate::model::VideoFormat::width_pixels].
    pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.width_pixels = v.into();
        self
    }

    /// Sets the value of [height_pixels][crate::model::VideoFormat::height_pixels].
    pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.height_pixels = v.into();
        self
    }

    /// Sets the value of [frame_rate][crate::model::VideoFormat::frame_rate].
    pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.frame_rate = v.into();
        self
    }
}

impl wkt::message::Message for VideoFormat {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.VideoFormat"
    }
}

/// Properties of the audio stream.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AudioStreamProperty {
    /// Index of this audio stream.
    pub index: i32,

    /// Properties of the audio format.
    pub audio_format: std::option::Option<crate::model::AudioFormat>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AudioStreamProperty {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [index][crate::model::AudioStreamProperty::index].
    pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.index = v.into();
        self
    }

    /// Sets the value of [audio_format][crate::model::AudioStreamProperty::audio_format].
    pub fn set_audio_format<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AudioFormat>,
    {
        self.audio_format = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [audio_format][crate::model::AudioStreamProperty::audio_format].
    pub fn set_or_clear_audio_format<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AudioFormat>,
    {
        self.audio_format = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for AudioStreamProperty {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.AudioStreamProperty"
    }
}

/// Properties of the audio format.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AudioFormat {
    /// Audio codec used in this audio stream.
    pub codec: std::string::String,

    /// The number of audio channels.
    pub channel_count: i32,

    /// A list of channel names specifying the layout of the audio channels.
    pub channel_layout: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AudioFormat {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec][crate::model::AudioFormat::codec].
    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.codec = v.into();
        self
    }

    /// Sets the value of [channel_count][crate::model::AudioFormat::channel_count].
    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.channel_count = v.into();
        self
    }

    /// Sets the value of [channel_layout][crate::model::AudioFormat::channel_layout].
    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for AudioFormat {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.AudioFormat"
    }
}

/// A group of information for attaching an input resource to this channel.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputAttachment {
    /// A unique key for this input attachment. The key must be 1-63
    /// characters in length. The key must begin and end with a letter (regardless
    /// of case) or a number, but can contain dashes or underscores in between.
    pub key: std::string::String,

    /// The resource name of an existing input, in the form of:
    /// `projects/{project}/locations/{location}/inputs/{inputId}`.
    pub input: std::string::String,

    /// Automatic failover configurations.
    pub automatic_failover: std::option::Option<crate::model::input_attachment::AutomaticFailover>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InputAttachment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::InputAttachment::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [input][crate::model::InputAttachment::input].
    pub fn set_input<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.input = v.into();
        self
    }

    /// Sets the value of [automatic_failover][crate::model::InputAttachment::automatic_failover].
    pub fn set_automatic_failover<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::input_attachment::AutomaticFailover>,
    {
        self.automatic_failover = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [automatic_failover][crate::model::InputAttachment::automatic_failover].
    pub fn set_or_clear_automatic_failover<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::input_attachment::AutomaticFailover>,
    {
        self.automatic_failover = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for InputAttachment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.InputAttachment"
    }
}

/// Defines additional types related to [InputAttachment].
pub mod input_attachment {
    #[allow(unused_imports)]
    use super::*;

    /// Configurations to follow when automatic failover happens.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AutomaticFailover {
        /// The
        /// [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s
        /// of inputs to failover to when this input is disconnected. Currently, only
        /// up to one backup input is supported.
        ///
        /// [google.cloud.video.livestream.v1.InputAttachment.key]: crate::model::InputAttachment::key
        pub input_keys: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AutomaticFailover {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [input_keys][crate::model::input_attachment::AutomaticFailover::input_keys].
        pub fn set_input_keys<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.input_keys = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for AutomaticFailover {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover"
        }
    }
}

/// Advanced configurations for auto-generated text streams.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoTranscriptionConfig {
    /// Optional. Whether auto-generated text streams are displayed synchronously
    /// or asynchronously with the original audio.
    pub display_timing: crate::model::auto_transcription_config::DisplayTiming,

    /// Optional. Tunes the latency and quality of auto-generated captions.
    pub quality_preset: crate::model::auto_transcription_config::QualityPreset,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AutoTranscriptionConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [display_timing][crate::model::AutoTranscriptionConfig::display_timing].
    pub fn set_display_timing<
        T: std::convert::Into<crate::model::auto_transcription_config::DisplayTiming>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.display_timing = v.into();
        self
    }

    /// Sets the value of [quality_preset][crate::model::AutoTranscriptionConfig::quality_preset].
    pub fn set_quality_preset<
        T: std::convert::Into<crate::model::auto_transcription_config::QualityPreset>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.quality_preset = v.into();
        self
    }
}

impl wkt::message::Message for AutoTranscriptionConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.AutoTranscriptionConfig"
    }
}

/// Defines additional types related to [AutoTranscriptionConfig].
pub mod auto_transcription_config {
    #[allow(unused_imports)]
    use super::*;

    /// Whether auto-generated text streams are displayed synchronously or
    /// asynchronously with the original audio.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum DisplayTiming {
        /// Display timing is not specified. Caption display will be asynchronous by
        /// default.
        Unspecified,
        /// Caption will be displayed asynchronous with audio.
        Async,
        /// Caption will be displayed synchronous with audio. This option increases
        /// overall media output latency, and reduces viewing latency between audio
        /// and auto-generated captions.
        Sync,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [DisplayTiming::value] or
        /// [DisplayTiming::name].
        UnknownValue(display_timing::UnknownValue),
    }

    #[doc(hidden)]
    pub mod display_timing {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl DisplayTiming {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Async => std::option::Option::Some(1),
                Self::Sync => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("DISPLAY_TIMING_UNSPECIFIED"),
                Self::Async => std::option::Option::Some("ASYNC"),
                Self::Sync => std::option::Option::Some("SYNC"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for DisplayTiming {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for DisplayTiming {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for DisplayTiming {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Async,
                2 => Self::Sync,
                _ => Self::UnknownValue(display_timing::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for DisplayTiming {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "DISPLAY_TIMING_UNSPECIFIED" => Self::Unspecified,
                "ASYNC" => Self::Async,
                "SYNC" => Self::Sync,
                _ => Self::UnknownValue(display_timing::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for DisplayTiming {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Async => serializer.serialize_i32(1),
                Self::Sync => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for DisplayTiming {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DisplayTiming>::new(
                ".google.cloud.video.livestream.v1.AutoTranscriptionConfig.DisplayTiming",
            ))
        }
    }

    /// Presets to tune the latency and quality of auto-generated captions.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum QualityPreset {
        /// Quality Preset is not specified. By default, BALANCED_QUALITY will be
        /// used.
        Unspecified,
        /// Reduce the latency of auto-generated captions. This may reduce the
        /// quality of the captions.
        LowLatency,
        /// Default behavior when QualityPreset is not specified.
        BalancedQuality,
        /// Increases the quality of the auto-generated captions at the cost of
        /// higher latency.
        ImprovedQuality,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [QualityPreset::value] or
        /// [QualityPreset::name].
        UnknownValue(quality_preset::UnknownValue),
    }

    #[doc(hidden)]
    pub mod quality_preset {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl QualityPreset {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::LowLatency => std::option::Option::Some(1),
                Self::BalancedQuality => std::option::Option::Some(2),
                Self::ImprovedQuality => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("QUALITY_PRESET_UNSPECIFIED"),
                Self::LowLatency => std::option::Option::Some("LOW_LATENCY"),
                Self::BalancedQuality => std::option::Option::Some("BALANCED_QUALITY"),
                Self::ImprovedQuality => std::option::Option::Some("IMPROVED_QUALITY"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for QualityPreset {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for QualityPreset {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for QualityPreset {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::LowLatency,
                2 => Self::BalancedQuality,
                3 => Self::ImprovedQuality,
                _ => Self::UnknownValue(quality_preset::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for QualityPreset {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "QUALITY_PRESET_UNSPECIFIED" => Self::Unspecified,
                "LOW_LATENCY" => Self::LowLatency,
                "BALANCED_QUALITY" => Self::BalancedQuality,
                "IMPROVED_QUALITY" => Self::ImprovedQuality,
                _ => Self::UnknownValue(quality_preset::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for QualityPreset {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::LowLatency => serializer.serialize_i32(1),
                Self::BalancedQuality => serializer.serialize_i32(2),
                Self::ImprovedQuality => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for QualityPreset {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<QualityPreset>::new(
                ".google.cloud.video.livestream.v1.AutoTranscriptionConfig.QualityPreset",
            ))
        }
    }
}

/// Event is a sub-resource of a channel, which can be scheduled by the user to
/// execute operations on a channel resource without having to stop the channel.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Event {
    /// The resource name of the event, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`.
    pub name: std::string::String,

    /// Output only. The creation time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined key/value metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// When this field is set to true, the event will be executed at the earliest
    /// time that the server can schedule the event and
    /// [execution_time][google.cloud.video.livestream.v1.Event.execution_time]
    /// will be populated with the time that the server actually schedules the
    /// event.
    ///
    /// [google.cloud.video.livestream.v1.Event.execution_time]: crate::model::Event::execution_time
    pub execute_now: bool,

    /// The time to execute the event. If you set
    /// [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to
    /// `true`, then do not set this field in the `CreateEvent` request. In
    /// this case, the server schedules the event and populates this field. If you
    /// set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to
    /// `false`, then you must set this field to at least 10 seconds in the future
    /// or else the event can't be created.
    ///
    /// [google.cloud.video.livestream.v1.Event.execute_now]: crate::model::Event::execute_now
    pub execution_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The state of the event.
    pub state: crate::model::event::State,

    /// Output only. An error object that describes the reason for the failure.
    /// This property is always present when `state` is `FAILED`.
    pub error: std::option::Option<rpc::model::Status>,

    /// Required. Operation to be executed by this event.
    pub task: std::option::Option<crate::model::event::Task>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Event {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Event::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Event::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Event::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Event::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Event::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Event::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [execute_now][crate::model::Event::execute_now].
    pub fn set_execute_now<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.execute_now = v.into();
        self
    }

    /// Sets the value of [execution_time][crate::model::Event::execution_time].
    pub fn set_execution_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.execution_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [execution_time][crate::model::Event::execution_time].
    pub fn set_or_clear_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.execution_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Event::state].
    pub fn set_state<T: std::convert::Into<crate::model::event::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [error][crate::model::Event::error].
    pub fn set_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error][crate::model::Event::error].
    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [task][crate::model::Event::task].
    ///
    /// Note that all the setters affecting `task` are mutually
    /// exclusive.
    pub fn set_task<T: std::convert::Into<std::option::Option<crate::model::event::Task>>>(
        mut self,
        v: T,
    ) -> Self {
        self.task = v.into();
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `InputSwitch`, `None` if the field is not set or
    /// holds a different branch.
    pub fn input_switch(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::event::InputSwitchTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::InputSwitch(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `InputSwitch`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_input_switch<
        T: std::convert::Into<std::boxed::Box<crate::model::event::InputSwitchTask>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.task = std::option::Option::Some(crate::model::event::Task::InputSwitch(v.into()));
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `AdBreak`, `None` if the field is not set or
    /// holds a different branch.
    pub fn ad_break(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::event::AdBreakTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::AdBreak(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `AdBreak`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_ad_break<
        T: std::convert::Into<std::boxed::Box<crate::model::event::AdBreakTask>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.task = std::option::Option::Some(crate::model::event::Task::AdBreak(v.into()));
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `ReturnToProgram`, `None` if the field is not set or
    /// holds a different branch.
    pub fn return_to_program(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::event::ReturnToProgramTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::ReturnToProgram(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `ReturnToProgram`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_return_to_program<
        T: std::convert::Into<std::boxed::Box<crate::model::event::ReturnToProgramTask>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.task = std::option::Option::Some(crate::model::event::Task::ReturnToProgram(v.into()));
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `Slate`, `None` if the field is not set or
    /// holds a different branch.
    pub fn slate(&self) -> std::option::Option<&std::boxed::Box<crate::model::event::SlateTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::Slate(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `Slate`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_slate<T: std::convert::Into<std::boxed::Box<crate::model::event::SlateTask>>>(
        mut self,
        v: T,
    ) -> Self {
        self.task = std::option::Option::Some(crate::model::event::Task::Slate(v.into()));
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `Mute`, `None` if the field is not set or
    /// holds a different branch.
    pub fn mute(&self) -> std::option::Option<&std::boxed::Box<crate::model::event::MuteTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::Mute(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `Mute`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_mute<T: std::convert::Into<std::boxed::Box<crate::model::event::MuteTask>>>(
        mut self,
        v: T,
    ) -> Self {
        self.task = std::option::Option::Some(crate::model::event::Task::Mute(v.into()));
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `Unmute`, `None` if the field is not set or
    /// holds a different branch.
    pub fn unmute(&self) -> std::option::Option<&std::boxed::Box<crate::model::event::UnmuteTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::Unmute(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `Unmute`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_unmute<T: std::convert::Into<std::boxed::Box<crate::model::event::UnmuteTask>>>(
        mut self,
        v: T,
    ) -> Self {
        self.task = std::option::Option::Some(crate::model::event::Task::Unmute(v.into()));
        self
    }

    /// The value of [task][crate::model::Event::task]
    /// if it holds a `UpdateEncryptions`, `None` if the field is not set or
    /// holds a different branch.
    pub fn update_encryptions(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::event::UpdateEncryptionsTask>> {
        #[allow(unreachable_patterns)]
        self.task.as_ref().and_then(|v| match v {
            crate::model::event::Task::UpdateEncryptions(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [task][crate::model::Event::task]
    /// to hold a `UpdateEncryptions`.
    ///
    /// Note that all the setters affecting `task` are
    /// mutually exclusive.
    pub fn set_update_encryptions<
        T: std::convert::Into<std::boxed::Box<crate::model::event::UpdateEncryptionsTask>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.task =
            std::option::Option::Some(crate::model::event::Task::UpdateEncryptions(v.into()));
        self
    }
}

impl wkt::message::Message for Event {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Event"
    }
}

/// Defines additional types related to [Event].
pub mod event {
    #[allow(unused_imports)]
    use super::*;

    /// Switches to another input stream. Automatic failover is then disabled.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct InputSwitchTask {
        /// The
        /// [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]
        /// of the input to switch to.
        ///
        /// [google.cloud.video.livestream.v1.InputAttachment.key]: crate::model::InputAttachment::key
        pub input_key: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl InputSwitchTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [input_key][crate::model::event::InputSwitchTask::input_key].
        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.input_key = v.into();
            self
        }
    }

    impl wkt::message::Message for InputSwitchTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.InputSwitchTask"
        }
    }

    /// Inserts a new ad opportunity.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AdBreakTask {
        /// Duration of an ad opportunity. Must be greater than 0.
        pub duration: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AdBreakTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [duration][crate::model::event::AdBreakTask::duration].
        pub fn set_duration<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.duration = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [duration][crate::model::event::AdBreakTask::duration].
        pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.duration = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for AdBreakTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.AdBreakTask"
        }
    }

    /// Inserts a slate.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SlateTask {
        /// Optional. Duration of the slate. Must be greater than 0 if specified.
        /// Omit this field for a long running slate.
        pub duration: std::option::Option<wkt::Duration>,

        /// Slate asset to use for the duration. If its duration is less than the
        /// duration of the SlateTask, then the slate loops. The slate must be
        /// represented in the form of:
        /// `projects/{project}/locations/{location}/assets/{assetId}`.
        pub asset: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SlateTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [duration][crate::model::event::SlateTask::duration].
        pub fn set_duration<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.duration = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [duration][crate::model::event::SlateTask::duration].
        pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.duration = v.map(|x| x.into());
            self
        }

        /// Sets the value of [asset][crate::model::event::SlateTask::asset].
        pub fn set_asset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.asset = v.into();
            self
        }
    }

    impl wkt::message::Message for SlateTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.SlateTask"
        }
    }

    /// Stops any events which are currently running. This only applies to events
    /// with a duration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ReturnToProgramTask {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ReturnToProgramTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for ReturnToProgramTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.ReturnToProgramTask"
        }
    }

    /// Mutes the stream.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MuteTask {
        /// Duration for which the stream should be muted. If omitted, the stream
        /// will be muted until an UnmuteTask event is sent.
        pub duration: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MuteTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [duration][crate::model::event::MuteTask::duration].
        pub fn set_duration<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.duration = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [duration][crate::model::event::MuteTask::duration].
        pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.duration = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for MuteTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.MuteTask"
        }
    }

    /// Unmutes the stream. The task fails if the stream is not currently muted.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct UnmuteTask {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl UnmuteTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for UnmuteTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.UnmuteTask"
        }
    }

    /// Update encryption settings.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct UpdateEncryptionsTask {
        /// Required. A list of
        /// [EncryptionUpdate][google.cloud.video.livestream.v1.EncryptionUpdate]s
        /// that updates the existing encryption settings.
        ///
        /// [google.cloud.video.livestream.v1.EncryptionUpdate]: crate::model::EncryptionUpdate
        pub encryptions: std::vec::Vec<crate::model::EncryptionUpdate>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl UpdateEncryptionsTask {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [encryptions][crate::model::event::UpdateEncryptionsTask::encryptions].
        pub fn set_encryptions<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::EncryptionUpdate>,
        {
            use std::iter::Iterator;
            self.encryptions = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for UpdateEncryptionsTask {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Event.UpdateEncryptionsTask"
        }
    }

    /// State of the event
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Event state is not specified.
        Unspecified,
        /// Event is scheduled but not executed yet.
        Scheduled,
        /// Event is being executed.
        Running,
        /// Event has been successfully executed.
        Succeeded,
        /// Event fails to be executed.
        Failed,
        /// Event has been created but not scheduled yet.
        Pending,
        /// Event was stopped before running for its full duration.
        Stopped,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Scheduled => std::option::Option::Some(1),
                Self::Running => std::option::Option::Some(2),
                Self::Succeeded => std::option::Option::Some(3),
                Self::Failed => std::option::Option::Some(4),
                Self::Pending => std::option::Option::Some(5),
                Self::Stopped => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Pending => std::option::Option::Some("PENDING"),
                Self::Stopped => std::option::Option::Some("STOPPED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Scheduled,
                2 => Self::Running,
                3 => Self::Succeeded,
                4 => Self::Failed,
                5 => Self::Pending,
                6 => Self::Stopped,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "SCHEDULED" => Self::Scheduled,
                "RUNNING" => Self::Running,
                "SUCCEEDED" => Self::Succeeded,
                "FAILED" => Self::Failed,
                "PENDING" => Self::Pending,
                "STOPPED" => Self::Stopped,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Scheduled => serializer.serialize_i32(1),
                Self::Running => serializer.serialize_i32(2),
                Self::Succeeded => serializer.serialize_i32(3),
                Self::Failed => serializer.serialize_i32(4),
                Self::Pending => serializer.serialize_i32(5),
                Self::Stopped => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.video.livestream.v1.Event.State",
            ))
        }
    }

    /// Required. Operation to be executed by this event.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Task {
        /// Switches to another input stream.
        InputSwitch(std::boxed::Box<crate::model::event::InputSwitchTask>),
        /// Inserts a new ad opportunity.
        AdBreak(std::boxed::Box<crate::model::event::AdBreakTask>),
        /// Stops any running ad break.
        ReturnToProgram(std::boxed::Box<crate::model::event::ReturnToProgramTask>),
        /// Inserts a slate.
        Slate(std::boxed::Box<crate::model::event::SlateTask>),
        /// Mutes the stream.
        Mute(std::boxed::Box<crate::model::event::MuteTask>),
        /// Unmutes the stream.
        Unmute(std::boxed::Box<crate::model::event::UnmuteTask>),
        /// Updates encryption settings.
        UpdateEncryptions(std::boxed::Box<crate::model::event::UpdateEncryptionsTask>),
    }
}

/// Clip is a sub-resource under channel. Each clip represents a clipping
/// operation that generates a VOD playlist from its channel given a set of
/// timestamp ranges.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Clip {
    /// The resource name of the clip, in the following format:
    /// `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`.
    /// `{clipId}` is a user-specified resource id that conforms to the following
    /// criteria:
    ///
    /// 1. 1 character minimum, 63 characters maximum
    /// 1. Only contains letters, digits, underscores, and hyphens
    pub name: std::string::String,

    /// Output only. The creation timestamp of the clip resource.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The timestamp when the clip request starts to be processed.
    pub start_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update timestamp of the clip resource.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// The labels associated with this resource. Each label is a key-value pair.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. The state of the clip.
    pub state: crate::model::clip::State,

    /// Specify the `output_uri` to determine where to place the clip segments and
    /// clip manifest files in Cloud Storage. The manifests specified in
    /// `clip_manifests` fields will be placed under this URI. The exact URI of the
    /// generated manifests will be provided in `clip_manifests.output_uri` for
    /// each manifest.
    /// Example:
    /// "output_uri": "gs://my-bucket/clip-outputs"
    /// "clip_manifests.output_uri": "gs://my-bucket/clip-outputs/main.m3u8"
    pub output_uri: std::string::String,

    /// Output only. An error object that describes the reason for the failure.
    /// This property only presents when `state` is `FAILED`.
    pub error: std::option::Option<rpc::model::Status>,

    /// The specified ranges of segments to generate a clip.
    pub slices: std::vec::Vec<crate::model::clip::Slice>,

    /// Required. A list of clip manifests. Currently only one clip manifest is
    /// allowed.
    pub clip_manifests: std::vec::Vec<crate::model::clip::ClipManifest>,

    /// Optional. OutputType of the clip. If not specified, the default value is
    /// MANIFEST.
    pub output_type: crate::model::clip::OutputType,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Clip {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Clip::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Clip::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Clip::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [start_time][crate::model::Clip::start_time].
    pub fn set_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time][crate::model::Clip::start_time].
    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Clip::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Clip::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Clip::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::Clip::state].
    pub fn set_state<T: std::convert::Into<crate::model::clip::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [output_uri][crate::model::Clip::output_uri].
    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.output_uri = v.into();
        self
    }

    /// Sets the value of [error][crate::model::Clip::error].
    pub fn set_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error][crate::model::Clip::error].
    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [slices][crate::model::Clip::slices].
    pub fn set_slices<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::clip::Slice>,
    {
        use std::iter::Iterator;
        self.slices = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [clip_manifests][crate::model::Clip::clip_manifests].
    pub fn set_clip_manifests<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::clip::ClipManifest>,
    {
        use std::iter::Iterator;
        self.clip_manifests = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [output_type][crate::model::Clip::output_type].
    pub fn set_output_type<T: std::convert::Into<crate::model::clip::OutputType>>(
        mut self,
        v: T,
    ) -> Self {
        self.output_type = v.into();
        self
    }
}

impl wkt::message::Message for Clip {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Clip"
    }
}

/// Defines additional types related to [Clip].
pub mod clip {
    #[allow(unused_imports)]
    use super::*;

    /// TimeSlice represents a tuple of Unix epoch timestamps that specifies a time
    /// range.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct TimeSlice {
        /// The mark-in Unix epoch time in the original live stream manifest.
        pub markin_time: std::option::Option<wkt::Timestamp>,

        /// The mark-out Unix epoch time in the original live stream manifest.
        pub markout_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl TimeSlice {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [markin_time][crate::model::clip::TimeSlice::markin_time].
        pub fn set_markin_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.markin_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [markin_time][crate::model::clip::TimeSlice::markin_time].
        pub fn set_or_clear_markin_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.markin_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [markout_time][crate::model::clip::TimeSlice::markout_time].
        pub fn set_markout_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.markout_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [markout_time][crate::model::clip::TimeSlice::markout_time].
        pub fn set_or_clear_markout_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.markout_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for TimeSlice {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Clip.TimeSlice"
        }
    }

    /// Slice represents a slice of the requested clip.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Slice {
        /// The allowlist forms of a slice.
        pub kind: std::option::Option<crate::model::clip::slice::Kind>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Slice {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [kind][crate::model::clip::Slice::kind].
        ///
        /// Note that all the setters affecting `kind` are mutually
        /// exclusive.
        pub fn set_kind<
            T: std::convert::Into<std::option::Option<crate::model::clip::slice::Kind>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.kind = v.into();
            self
        }

        /// The value of [kind][crate::model::clip::Slice::kind]
        /// if it holds a `TimeSlice`, `None` if the field is not set or
        /// holds a different branch.
        pub fn time_slice(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::clip::TimeSlice>> {
            #[allow(unreachable_patterns)]
            self.kind.as_ref().and_then(|v| match v {
                crate::model::clip::slice::Kind::TimeSlice(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [kind][crate::model::clip::Slice::kind]
        /// to hold a `TimeSlice`.
        ///
        /// Note that all the setters affecting `kind` are
        /// mutually exclusive.
        pub fn set_time_slice<
            T: std::convert::Into<std::boxed::Box<crate::model::clip::TimeSlice>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.kind =
                std::option::Option::Some(crate::model::clip::slice::Kind::TimeSlice(v.into()));
            self
        }
    }

    impl wkt::message::Message for Slice {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Clip.Slice"
        }
    }

    /// Defines additional types related to [Slice].
    pub mod slice {
        #[allow(unused_imports)]
        use super::*;

        /// The allowlist forms of a slice.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Kind {
            /// A slice in form of a tuple of Unix epoch time.
            TimeSlice(std::boxed::Box<crate::model::clip::TimeSlice>),
        }
    }

    /// ClipManifest identifies a source manifest for the generated clip manifest.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ClipManifest {
        /// Required. A unique key that identifies a manifest config in the parent
        /// channel. This key is the same as `channel.manifests.key` for the selected
        /// manifest.
        pub manifest_key: std::string::String,

        /// Output only. The output URI of the generated clip manifest. This field
        /// will be populated when the CreateClip request is accepted. Current output
        /// format is provided below but may change in the future. Please read this
        /// field to get the uri to the generated clip manifest. Format:
        /// {clip.output_uri}/{channel.manifest.fileName} Example:
        /// gs://my-bucket/clip-outputs/main.m3u8
        pub output_uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ClipManifest {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [manifest_key][crate::model::clip::ClipManifest::manifest_key].
        pub fn set_manifest_key<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.manifest_key = v.into();
            self
        }

        /// Sets the value of [output_uri][crate::model::clip::ClipManifest::output_uri].
        pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.output_uri = v.into();
            self
        }
    }

    impl wkt::message::Message for ClipManifest {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Clip.ClipManifest"
        }
    }

    /// State of clipping operation.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is not specified.
        Unspecified,
        /// The operation is pending to be picked up by the server.
        Pending,
        /// The server admitted this create clip request, and
        /// outputs are under processing.
        Creating,
        /// Outputs are available in the specified Cloud Storage bucket. For
        /// additional information, see the `outputs` field.
        Succeeded,
        /// The operation has failed. For additional information, see the `error`
        /// field.
        Failed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Pending => std::option::Option::Some(1),
                Self::Creating => std::option::Option::Some(2),
                Self::Succeeded => std::option::Option::Some(3),
                Self::Failed => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Pending => std::option::Option::Some("PENDING"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Pending,
                2 => Self::Creating,
                3 => Self::Succeeded,
                4 => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "PENDING" => Self::Pending,
                "CREATING" => Self::Creating,
                "SUCCEEDED" => Self::Succeeded,
                "FAILED" => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Pending => serializer.serialize_i32(1),
                Self::Creating => serializer.serialize_i32(2),
                Self::Succeeded => serializer.serialize_i32(3),
                Self::Failed => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.video.livestream.v1.Clip.State",
            ))
        }
    }

    /// OutputType represents the output type of the clip.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum OutputType {
        /// OutputType is not specified.
        Unspecified,
        /// OutputType is a VOD manifest. This is the default value.
        Manifest,
        /// OutputType is an MP4 file.
        Mp4,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [OutputType::value] or
        /// [OutputType::name].
        UnknownValue(output_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod output_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl OutputType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Manifest => std::option::Option::Some(1),
                Self::Mp4 => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("OUTPUT_TYPE_UNSPECIFIED"),
                Self::Manifest => std::option::Option::Some("MANIFEST"),
                Self::Mp4 => std::option::Option::Some("MP4"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for OutputType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for OutputType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for OutputType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Manifest,
                2 => Self::Mp4,
                _ => Self::UnknownValue(output_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for OutputType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "OUTPUT_TYPE_UNSPECIFIED" => Self::Unspecified,
                "MANIFEST" => Self::Manifest,
                "MP4" => Self::Mp4,
                _ => Self::UnknownValue(output_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for OutputType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Manifest => serializer.serialize_i32(1),
                Self::Mp4 => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for OutputType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OutputType>::new(
                ".google.cloud.video.livestream.v1.Clip.OutputType",
            ))
        }
    }
}

/// TimeInterval represents a time interval.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimeInterval {
    /// Optional. The start time of the interval.
    pub start_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The end time of the interval.
    pub end_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TimeInterval {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [start_time][crate::model::TimeInterval::start_time].
    pub fn set_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time][crate::model::TimeInterval::start_time].
    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::TimeInterval::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::TimeInterval::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for TimeInterval {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.TimeInterval"
    }
}

/// DvrSession is a sub-resource under channel. Each DvrSession represents a DVR
/// recording of the live stream for a specific time range.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DvrSession {
    /// Identifier. The resource name of the DVR session, in the following format:
    /// `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`.
    /// `{dvrSessionId}` is a user-specified resource id that conforms to the
    /// following criteria:
    ///
    /// 1. 1 character minimum, 63 characters maximum
    /// 1. Only contains letters, digits, underscores, and hyphens
    pub name: std::string::String,

    /// Output only. The creation time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. User-defined key/value metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. The state of the clip.
    pub state: crate::model::dvr_session::State,

    /// Output only. An error object that describes the reason for the failure.
    /// This property only presents when `state` is `FAILED`.
    pub error: std::option::Option<rpc::model::Status>,

    /// Required. A list of DVR manifests. Currently only one DVR manifest is
    /// allowed.
    pub dvr_manifests: std::vec::Vec<crate::model::dvr_session::DvrManifest>,

    /// Required. The specified ranges of segments to generate a DVR recording.
    pub dvr_windows: std::vec::Vec<crate::model::dvr_session::DvrWindow>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DvrSession {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DvrSession::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::DvrSession::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::DvrSession::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::DvrSession::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::DvrSession::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::DvrSession::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::DvrSession::state].
    pub fn set_state<T: std::convert::Into<crate::model::dvr_session::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [error][crate::model::DvrSession::error].
    pub fn set_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error][crate::model::DvrSession::error].
    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [dvr_manifests][crate::model::DvrSession::dvr_manifests].
    pub fn set_dvr_manifests<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::dvr_session::DvrManifest>,
    {
        use std::iter::Iterator;
        self.dvr_manifests = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [dvr_windows][crate::model::DvrSession::dvr_windows].
    pub fn set_dvr_windows<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::dvr_session::DvrWindow>,
    {
        use std::iter::Iterator;
        self.dvr_windows = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for DvrSession {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DvrSession"
    }
}

/// Defines additional types related to [DvrSession].
pub mod dvr_session {
    #[allow(unused_imports)]
    use super::*;

    /// DvrManifest identifies a source manifest and specifies a file name for the
    /// generated DVR manifest.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DvrManifest {
        /// Required. A unique key that identifies a manifest config in the parent
        /// channel. This key is the same as `channel.manifests.key` for the selected
        /// manifest.
        pub manifest_key: std::string::String,

        /// Output only. The output URI of the DVR manifest. The DVR output will be
        /// placed in a directory named `dvr/dvrSessionId/` under the parent
        /// channel's output uri. Format:
        /// {channel.output.uri}/dvr/{dvrSessionId}/{channel.manifests.fileName}
        /// Example: gs://my-bucket/outputs/dvr/my-dvr-session/main.m3u8
        pub output_uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DvrManifest {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [manifest_key][crate::model::dvr_session::DvrManifest::manifest_key].
        pub fn set_manifest_key<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.manifest_key = v.into();
            self
        }

        /// Sets the value of [output_uri][crate::model::dvr_session::DvrManifest::output_uri].
        pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.output_uri = v.into();
            self
        }
    }

    impl wkt::message::Message for DvrManifest {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.DvrSession.DvrManifest"
        }
    }

    /// DvrWindow represents a DVR window.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DvrWindow {
        /// The allowlist forms of a DVR window.
        pub kind: std::option::Option<crate::model::dvr_session::dvr_window::Kind>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DvrWindow {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [kind][crate::model::dvr_session::DvrWindow::kind].
        ///
        /// Note that all the setters affecting `kind` are mutually
        /// exclusive.
        pub fn set_kind<
            T: std::convert::Into<std::option::Option<crate::model::dvr_session::dvr_window::Kind>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.kind = v.into();
            self
        }

        /// The value of [kind][crate::model::dvr_session::DvrWindow::kind]
        /// if it holds a `TimeInterval`, `None` if the field is not set or
        /// holds a different branch.
        pub fn time_interval(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::TimeInterval>> {
            #[allow(unreachable_patterns)]
            self.kind.as_ref().and_then(|v| match v {
                crate::model::dvr_session::dvr_window::Kind::TimeInterval(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [kind][crate::model::dvr_session::DvrWindow::kind]
        /// to hold a `TimeInterval`.
        ///
        /// Note that all the setters affecting `kind` are
        /// mutually exclusive.
        pub fn set_time_interval<
            T: std::convert::Into<std::boxed::Box<crate::model::TimeInterval>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.kind = std::option::Option::Some(
                crate::model::dvr_session::dvr_window::Kind::TimeInterval(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for DvrWindow {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.DvrSession.DvrWindow"
        }
    }

    /// Defines additional types related to [DvrWindow].
    pub mod dvr_window {
        #[allow(unused_imports)]
        use super::*;

        /// The allowlist forms of a DVR window.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Kind {
            /// A time interval in the form of a tuple of Unix epoch time.
            TimeInterval(std::boxed::Box<crate::model::TimeInterval>),
        }
    }

    /// State of the DVR session.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is not specified.
        Unspecified,
        /// The operation is pending to be picked up by the server.
        Pending,
        /// The session is being updated.
        Updating,
        /// The session is scheduled and waiting for the start time.
        Scheduled,
        /// The session is currently in progress and the outputs are available in the
        /// specified Cloud Storage bucket. For additional information, see the
        /// `dvr_manifests.output_uri` field.
        Live,
        /// Outputs are available in the specified Cloud Storage bucket. For
        /// additional information, see the `dvr_manifests.output_uri` field.
        Finished,
        /// The operation has failed. For additional information, see the `error`
        /// field.
        Failed,
        /// The session is being deleted.
        Deleting,
        /// The session is being post processed.
        PostProcessing,
        /// The session is in cooldown. The cooldown period lasts for 60 seconds.
        /// When the DVR session is updated by the user to have a new end time that
        /// is likely already in the past, the DVR manifest will end as soon as
        /// possible and the DVR session will move to this state. This is done to
        /// prevent the players to receive a manifest update that removes a segment
        /// that has already been played. After the cooldown period ends, a new
        /// manifest is generated that honors the new end time.
        Cooldown,
        /// The session is being stopped. The session will move to STOPPING state, if
        /// the parent channel is updated.
        Stopping,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Pending => std::option::Option::Some(1),
                Self::Updating => std::option::Option::Some(2),
                Self::Scheduled => std::option::Option::Some(3),
                Self::Live => std::option::Option::Some(4),
                Self::Finished => std::option::Option::Some(5),
                Self::Failed => std::option::Option::Some(6),
                Self::Deleting => std::option::Option::Some(7),
                Self::PostProcessing => std::option::Option::Some(8),
                Self::Cooldown => std::option::Option::Some(9),
                Self::Stopping => std::option::Option::Some(10),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Pending => std::option::Option::Some("PENDING"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
                Self::Live => std::option::Option::Some("LIVE"),
                Self::Finished => std::option::Option::Some("FINISHED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::PostProcessing => std::option::Option::Some("POST_PROCESSING"),
                Self::Cooldown => std::option::Option::Some("COOLDOWN"),
                Self::Stopping => std::option::Option::Some("STOPPING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Pending,
                2 => Self::Updating,
                3 => Self::Scheduled,
                4 => Self::Live,
                5 => Self::Finished,
                6 => Self::Failed,
                7 => Self::Deleting,
                8 => Self::PostProcessing,
                9 => Self::Cooldown,
                10 => Self::Stopping,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "PENDING" => Self::Pending,
                "UPDATING" => Self::Updating,
                "SCHEDULED" => Self::Scheduled,
                "LIVE" => Self::Live,
                "FINISHED" => Self::Finished,
                "FAILED" => Self::Failed,
                "DELETING" => Self::Deleting,
                "POST_PROCESSING" => Self::PostProcessing,
                "COOLDOWN" => Self::Cooldown,
                "STOPPING" => Self::Stopping,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Pending => serializer.serialize_i32(1),
                Self::Updating => serializer.serialize_i32(2),
                Self::Scheduled => serializer.serialize_i32(3),
                Self::Live => serializer.serialize_i32(4),
                Self::Finished => serializer.serialize_i32(5),
                Self::Failed => serializer.serialize_i32(6),
                Self::Deleting => serializer.serialize_i32(7),
                Self::PostProcessing => serializer.serialize_i32(8),
                Self::Cooldown => serializer.serialize_i32(9),
                Self::Stopping => serializer.serialize_i32(10),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.video.livestream.v1.DvrSession.State",
            ))
        }
    }
}

/// An asset represents a video or an image.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Asset {
    /// The resource name of the asset, in the form of:
    /// `projects/{project}/locations/{location}/assets/{assetId}`.
    pub name: std::string::String,

    /// Output only. The creation time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined key/value metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Based64-encoded CRC32c checksum of the asset file. For more information,
    /// see the crc32c checksum of the [Cloud Storage Objects
    /// resource](https://cloud.google.com/storage/docs/json_api/v1/objects).
    /// If crc32c is omitted or left empty when the asset is created, this field is
    /// filled by the crc32c checksum of the Cloud Storage object indicated by
    /// [VideoAsset.uri][google.cloud.video.livestream.v1.Asset.VideoAsset.uri] or
    /// [ImageAsset.uri][google.cloud.video.livestream.v1.Asset.ImageAsset.uri]. If
    /// crc32c is set, the asset can't be created if the crc32c value does not
    /// match with the crc32c checksum of the Cloud Storage object indicated by
    /// [VideoAsset.uri][google.cloud.video.livestream.v1.Asset.VideoAsset.uri] or
    /// [ImageAsset.uri][google.cloud.video.livestream.v1.Asset.ImageAsset.uri].
    ///
    /// [google.cloud.video.livestream.v1.Asset.ImageAsset.uri]: crate::model::asset::ImageAsset::uri
    /// [google.cloud.video.livestream.v1.Asset.VideoAsset.uri]: crate::model::asset::VideoAsset::uri
    pub crc32c: std::string::String,

    /// Output only. The state of the asset resource.
    pub state: crate::model::asset::State,

    /// Output only. Only present when `state` is `ERROR`. The reason for the error
    /// state of the asset.
    pub error: std::option::Option<rpc::model::Status>,

    /// The reference to the asset.
    /// The maximum size of the resource is 250 MB.
    pub resource: std::option::Option<crate::model::asset::Resource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Asset {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Asset::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Asset::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Asset::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Asset::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Asset::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Asset::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [crc32c][crate::model::Asset::crc32c].
    pub fn set_crc32c<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.crc32c = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Asset::state].
    pub fn set_state<T: std::convert::Into<crate::model::asset::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [error][crate::model::Asset::error].
    pub fn set_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error][crate::model::Asset::error].
    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resource][crate::model::Asset::resource].
    ///
    /// Note that all the setters affecting `resource` are mutually
    /// exclusive.
    pub fn set_resource<
        T: std::convert::Into<std::option::Option<crate::model::asset::Resource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.resource = v.into();
        self
    }

    /// The value of [resource][crate::model::Asset::resource]
    /// if it holds a `Video`, `None` if the field is not set or
    /// holds a different branch.
    pub fn video(&self) -> std::option::Option<&std::boxed::Box<crate::model::asset::VideoAsset>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::asset::Resource::Video(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::Asset::resource]
    /// to hold a `Video`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_video<T: std::convert::Into<std::boxed::Box<crate::model::asset::VideoAsset>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource = std::option::Option::Some(crate::model::asset::Resource::Video(v.into()));
        self
    }

    /// The value of [resource][crate::model::Asset::resource]
    /// if it holds a `Image`, `None` if the field is not set or
    /// holds a different branch.
    pub fn image(&self) -> std::option::Option<&std::boxed::Box<crate::model::asset::ImageAsset>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::asset::Resource::Image(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::Asset::resource]
    /// to hold a `Image`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_image<T: std::convert::Into<std::boxed::Box<crate::model::asset::ImageAsset>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource = std::option::Option::Some(crate::model::asset::Resource::Image(v.into()));
        self
    }
}

impl wkt::message::Message for Asset {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Asset"
    }
}

/// Defines additional types related to [Asset].
pub mod asset {
    #[allow(unused_imports)]
    use super::*;

    /// VideoAsset represents a video. The supported formats are MP4, MPEG-TS, and
    /// FLV. The supported video codec is H264. The supported audio codecs are
    /// AAC, AC3, MP2, and MP3.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct VideoAsset {
        /// Cloud Storage URI of the video. The format is `gs://my-bucket/my-object`.
        pub uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl VideoAsset {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [uri][crate::model::asset::VideoAsset::uri].
        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.uri = v.into();
            self
        }
    }

    impl wkt::message::Message for VideoAsset {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Asset.VideoAsset"
        }
    }

    /// Image represents an image. The supported formats are JPEG, PNG.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ImageAsset {
        /// Cloud Storage URI of the image. The format is `gs://my-bucket/my-object`.
        pub uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ImageAsset {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [uri][crate::model::asset::ImageAsset::uri].
        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.uri = v.into();
            self
        }
    }

    impl wkt::message::Message for ImageAsset {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Asset.ImageAsset"
        }
    }

    /// State of the asset resource.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// State is not specified.
        Unspecified,
        /// The asset is being created.
        Creating,
        /// The asset is ready for use.
        Active,
        /// The asset is being deleted.
        Deleting,
        /// The asset has an error.
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::Error => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Deleting,
                4 => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "DELETING" => Self::Deleting,
                "ERROR" => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::Error => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.video.livestream.v1.Asset.State",
            ))
        }
    }

    /// The reference to the asset.
    /// The maximum size of the resource is 250 MB.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Resource {
        /// VideoAsset represents a video.
        Video(std::boxed::Box<crate::model::asset::VideoAsset>),
        /// ImageAsset represents an image.
        Image(std::boxed::Box<crate::model::asset::ImageAsset>),
    }
}

/// Encryption settings.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encryption {
    /// Required. Identifier for this set of encryption options. The ID must be
    /// 1-63 characters in length. The ID must begin and end with a letter
    /// (regardless of case) or a number, but can contain dashes or underscores in
    /// between.
    pub id: std::string::String,

    /// Required. Configuration for DRM systems.
    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,

    /// Defines where content keys are stored.
    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,

    /// Encryption modes for HLS and MPEG-Dash.
    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Encryption {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [id][crate::model::Encryption::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
    pub fn set_drm_systems<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::encryption::DrmSystems>,
    {
        self.drm_systems = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::encryption::DrmSystems>,
    {
        self.drm_systems = v.map(|x| x.into());
        self
    }

    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
    ///
    /// Note that all the setters affecting `secret_source` are mutually
    /// exclusive.
    pub fn set_secret_source<
        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.secret_source = v.into();
        self
    }

    /// The value of [secret_source][crate::model::Encryption::secret_source]
    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
    /// holds a different branch.
    pub fn secret_manager_key_source(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
        #[allow(unreachable_patterns)]
        self.secret_source.as_ref().and_then(|v| match v {
            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
    /// to hold a `SecretManagerKeySource`.
    ///
    /// Note that all the setters affecting `secret_source` are
    /// mutually exclusive.
    pub fn set_secret_manager_key_source<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.secret_source = std::option::Option::Some(
            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
        );
        self
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
    ///
    /// Note that all the setters affecting `encryption_mode` are mutually
    /// exclusive.
    pub fn set_encryption_mode<
        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode = v.into();
        self
    }

    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// if it holds a `Aes128`, `None` if the field is not set or
    /// holds a different branch.
    pub fn aes128(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
        #[allow(unreachable_patterns)]
        self.encryption_mode.as_ref().and_then(|v| match v {
            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// to hold a `Aes128`.
    ///
    /// Note that all the setters affecting `encryption_mode` are
    /// mutually exclusive.
    pub fn set_aes128<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode =
            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
        self
    }

    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// if it holds a `SampleAes`, `None` if the field is not set or
    /// holds a different branch.
    pub fn sample_aes(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
        #[allow(unreachable_patterns)]
        self.encryption_mode.as_ref().and_then(|v| match v {
            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// to hold a `SampleAes`.
    ///
    /// Note that all the setters affecting `encryption_mode` are
    /// mutually exclusive.
    pub fn set_sample_aes<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode = std::option::Option::Some(
            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
        );
        self
    }

    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// if it holds a `MpegCenc`, `None` if the field is not set or
    /// holds a different branch.
    pub fn mpeg_cenc(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
        #[allow(unreachable_patterns)]
        self.encryption_mode.as_ref().and_then(|v| match v {
            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// to hold a `MpegCenc`.
    ///
    /// Note that all the setters affecting `encryption_mode` are
    /// mutually exclusive.
    pub fn set_mpeg_cenc<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode =
            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
        self
    }
}

impl wkt::message::Message for Encryption {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Encryption"
    }
}

/// Defines additional types related to [Encryption].
pub mod encryption {
    #[allow(unused_imports)]
    use super::*;

    /// Configuration for secrets stored in Google Secret Manager.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SecretManagerSource {
        /// Required. The name of the Secret Version containing the encryption key.
        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
        pub secret_version: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SecretManagerSource {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.secret_version = v.into();
            self
        }
    }

    impl wkt::message::Message for SecretManagerSource {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.SecretManagerSource"
        }
    }

    /// Widevine configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Widevine {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Widevine {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Widevine {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.Widevine"
        }
    }

    /// Fairplay configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Fairplay {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Fairplay {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Fairplay {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.Fairplay"
        }
    }

    /// Playready configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Playready {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Playready {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Playready {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.Playready"
        }
    }

    /// Clearkey configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Clearkey {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Clearkey {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Clearkey {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.Clearkey"
        }
    }

    /// Defines configuration for DRM systems in use. If a field is omitted,
    /// that DRM system will be considered to be disabled.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DrmSystems {
        /// Optional. Widevine configuration.
        pub widevine: std::option::Option<crate::model::encryption::Widevine>,

        /// Optional. Fairplay configuration.
        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,

        /// Optional. Playready configuration.
        pub playready: std::option::Option<crate::model::encryption::Playready>,

        /// Optional. Clearkey configuration.
        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DrmSystems {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
        pub fn set_widevine<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Widevine>,
        {
            self.widevine = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Widevine>,
        {
            self.widevine = v.map(|x| x.into());
            self
        }

        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
        pub fn set_fairplay<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Fairplay>,
        {
            self.fairplay = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Fairplay>,
        {
            self.fairplay = v.map(|x| x.into());
            self
        }

        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
        pub fn set_playready<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Playready>,
        {
            self.playready = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Playready>,
        {
            self.playready = v.map(|x| x.into());
            self
        }

        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
        pub fn set_clearkey<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Clearkey>,
        {
            self.clearkey = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Clearkey>,
        {
            self.clearkey = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for DrmSystems {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.DrmSystems"
        }
    }

    /// Configuration for HLS AES-128 encryption.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Aes128Encryption {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Aes128Encryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Aes128Encryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.Aes128Encryption"
        }
    }

    /// Configuration for HLS SAMPLE-AES encryption.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SampleAesEncryption {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SampleAesEncryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for SampleAesEncryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.SampleAesEncryption"
        }
    }

    /// Configuration for MPEG-Dash Common Encryption (MPEG-CENC).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MpegCommonEncryption {
        /// Required. Specify the encryption scheme, supported schemes:
        ///
        /// - `cenc` - AES-CTR subsample
        /// - `cbcs`- AES-CBC subsample pattern
        pub scheme: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MpegCommonEncryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.scheme = v.into();
            self
        }
    }

    impl wkt::message::Message for MpegCommonEncryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption"
        }
    }

    /// Defines where content keys are stored.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum SecretSource {
        /// For keys stored in Google Secret Manager.
        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
    }

    /// Encryption modes for HLS and MPEG-Dash.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum EncryptionMode {
        /// Configuration for HLS AES-128 encryption.
        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
        /// Configuration for HLS SAMPLE-AES encryption.
        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
        /// Configuration for MPEG-Dash Common Encryption (MPEG-CENC).
        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
    }
}

/// Encryption setting when updating encryption.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionUpdate {
    /// Required. Identifier for the encryption option to be updated.
    pub id: std::string::String,

    /// Defines where new content keys are stored.
    pub secret_source: std::option::Option<crate::model::encryption_update::SecretSource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EncryptionUpdate {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [id][crate::model::EncryptionUpdate::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [secret_source][crate::model::EncryptionUpdate::secret_source].
    ///
    /// Note that all the setters affecting `secret_source` are mutually
    /// exclusive.
    pub fn set_secret_source<
        T: std::convert::Into<std::option::Option<crate::model::encryption_update::SecretSource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.secret_source = v.into();
        self
    }

    /// The value of [secret_source][crate::model::EncryptionUpdate::secret_source]
    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
    /// holds a different branch.
    pub fn secret_manager_key_source(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
        #[allow(unreachable_patterns)]
        self.secret_source.as_ref().and_then(|v| match v {
            crate::model::encryption_update::SecretSource::SecretManagerKeySource(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [secret_source][crate::model::EncryptionUpdate::secret_source]
    /// to hold a `SecretManagerKeySource`.
    ///
    /// Note that all the setters affecting `secret_source` are
    /// mutually exclusive.
    pub fn set_secret_manager_key_source<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.secret_source = std::option::Option::Some(
            crate::model::encryption_update::SecretSource::SecretManagerKeySource(v.into()),
        );
        self
    }
}

impl wkt::message::Message for EncryptionUpdate {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.EncryptionUpdate"
    }
}

/// Defines additional types related to [EncryptionUpdate].
pub mod encryption_update {
    #[allow(unused_imports)]
    use super::*;

    /// Defines where new content keys are stored.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum SecretSource {
        /// For keys stored in Google Secret Manager.
        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
    }
}

/// Pool resource defines the configuration of Live Stream pools for a specific
/// location. Currently we support only one pool resource per project per
/// location. After the creation of the first input, a default pool is created
/// automatically at "projects/{project}/locations/{location}/pools/default".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Pool {
    /// The resource name of the pool, in the form of:
    /// `projects/{project}/locations/{location}/pools/{poolId}`.
    pub name: std::string::String,

    /// Output only. The creation time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined key/value metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Network configuration for the pool.
    pub network_config: std::option::Option<crate::model::pool::NetworkConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Pool {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Pool::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Pool::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Pool::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Pool::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Pool::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Pool::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [network_config][crate::model::Pool::network_config].
    pub fn set_network_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::pool::NetworkConfig>,
    {
        self.network_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [network_config][crate::model::Pool::network_config].
    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::pool::NetworkConfig>,
    {
        self.network_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Pool {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.Pool"
    }
}

/// Defines additional types related to [Pool].
pub mod pool {
    #[allow(unused_imports)]
    use super::*;

    /// Defines the network configuration for the pool.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct NetworkConfig {
        /// peered_network is the network resource URL of the network that is peered
        /// to the service provider network. Must be of the format
        /// projects/NETWORK_PROJECT_NUMBER/global/networks/NETWORK_NAME, where
        /// NETWORK_PROJECT_NUMBER is the project number of the Cloud project that
        /// holds your VPC network and NETWORK_NAME is the name of your VPC network.
        /// If peered_network is omitted or empty, the pool will use endpoints that
        /// are publicly available.
        pub peered_network: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl NetworkConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [peered_network][crate::model::pool::NetworkConfig::peered_network].
        pub fn set_peered_network<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peered_network = v.into();
            self
        }
    }

    impl wkt::message::Message for NetworkConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.livestream.v1.Pool.NetworkConfig"
        }
    }
}

/// Request message for "LivestreamService.CreateAsset".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAssetRequest {
    /// Required. The parent location for the resource, in the form of:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. The asset resource to be created.
    pub asset: std::option::Option<crate::model::Asset>,

    /// Required. The ID of the asset resource to be created.
    ///
    /// This value must be 1-63 characters, begin and end with a lower-case letter
    /// or a number, and consist of only lower-case letters, numbers, and hyphens.
    /// In other words, it must match the following regex:
    /// `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
    pub asset_id: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateAssetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateAssetRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [asset][crate::model::CreateAssetRequest::asset].
    pub fn set_asset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Asset>,
    {
        self.asset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [asset][crate::model::CreateAssetRequest::asset].
    pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Asset>,
    {
        self.asset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [asset_id][crate::model::CreateAssetRequest::asset_id].
    pub fn set_asset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.asset_id = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::CreateAssetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateAssetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.CreateAssetRequest"
    }
}

/// Request message for "LivestreamService.DeleteAsset".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAssetRequest {
    /// Required. The name of the asset resource, in the form of:
    /// `projects/{project}/locations/{location}/assets/{assetId}`.
    pub name: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteAssetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteAssetRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteAssetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteAssetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DeleteAssetRequest"
    }
}

/// Request message for "LivestreamService.ListAssets".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetsRequest {
    /// Required. The parent location for the resource, in the form of:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAssetsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListAssetsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListAssetsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListAssetsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListAssetsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListAssetsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListAssetsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListAssetsRequest"
    }
}

/// Response message for "LivestreamService.ListAssets".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetsResponse {
    /// The list of Assets
    pub assets: std::vec::Vec<crate::model::Asset>,

    /// The next_page_token value returned from a previous List request, if any.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAssetsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [assets][crate::model::ListAssetsResponse::assets].
    pub fn set_assets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Asset>,
    {
        use std::iter::Iterator;
        self.assets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListAssetsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListAssetsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListAssetsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListAssetsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListAssetsResponse {
    type PageItem = crate::model::Asset;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.assets
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for "LivestreamService.GetAsset".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAssetRequest {
    /// Required. Name of the resource, in the following form:
    /// `projects/{project}/locations/{location}/assets/{asset}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetAssetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetAssetRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetAssetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetAssetRequest"
    }
}

/// Request message for "LivestreamService.CreateChannel".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateChannelRequest {
    /// Required. The parent location for the resource, in the form of:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. The channel resource to be created.
    pub channel: std::option::Option<crate::model::Channel>,

    /// Required. The ID of the channel resource to be created.
    ///
    /// This value must be 1-63 characters, begin and end with a lower-case letter
    /// or a number, and consist of only lower-case letters, numbers, and hyphens.
    /// In other words, it must match the following regex:
    /// `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
    pub channel_id: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateChannelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateChannelRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [channel][crate::model::CreateChannelRequest::channel].
    pub fn set_channel<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Channel>,
    {
        self.channel = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [channel][crate::model::CreateChannelRequest::channel].
    pub fn set_or_clear_channel<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Channel>,
    {
        self.channel = v.map(|x| x.into());
        self
    }

    /// Sets the value of [channel_id][crate::model::CreateChannelRequest::channel_id].
    pub fn set_channel_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.channel_id = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::CreateChannelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateChannelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.CreateChannelRequest"
    }
}

/// Request message for "LivestreamService.ListChannels".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListChannelsRequest {
    /// Required. The parent location for the resource, in the form of:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// The maximum number of items to return. If unspecified, server
    /// will pick an appropriate default. Server may return fewer items than
    /// requested. A caller should only rely on response's
    /// [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token]
    /// to determine if there are more items left to be queried.
    ///
    /// [google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token]: crate::model::ListChannelsResponse::next_page_token
    pub page_size: i32,

    /// The next_page_token value returned from a previous List request, if any.
    pub page_token: std::string::String,

    /// The filter to apply to list results.
    pub filter: std::string::String,

    /// Specifies the ordering of results following syntax at
    /// <https://cloud.google.com/apis/design/design_patterns#sorting_order>.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListChannelsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListChannelsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListChannelsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListChannelsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListChannelsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListChannelsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListChannelsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListChannelsRequest"
    }
}

/// Response message for "LivestreamService.ListChannels".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListChannelsResponse {
    /// A list of channels.
    pub channels: std::vec::Vec<crate::model::Channel>,

    /// Token to retrieve the next page of results, or empty if there are no more
    /// results in the list.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListChannelsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [channels][crate::model::ListChannelsResponse::channels].
    pub fn set_channels<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Channel>,
    {
        use std::iter::Iterator;
        self.channels = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListChannelsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListChannelsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListChannelsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListChannelsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListChannelsResponse {
    type PageItem = crate::model::Channel;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.channels
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for "LivestreamService.GetChannel".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetChannelRequest {
    /// Required. The name of the channel resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetChannelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetChannelRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetChannelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetChannelRequest"
    }
}

/// Request message for "LivestreamService.DeleteChannel".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteChannelRequest {
    /// Required. The name of the channel resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    /// If the `force` field is set to the default value of `false`, you must
    /// delete all of a channel's events before you can delete the channel itself.
    /// If the field is set to `true`, requests to delete a channel also delete
    /// associated channel events.
    pub force: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteChannelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteChannelRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteChannelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [force][crate::model::DeleteChannelRequest::force].
    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.force = v.into();
        self
    }
}

impl wkt::message::Message for DeleteChannelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DeleteChannelRequest"
    }
}

/// Request message for "LivestreamService.UpdateChannel".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateChannelRequest {
    /// Field mask is used to specify the fields to be overwritten in the Channel
    /// resource by the update. You can only update the following fields:
    ///
    /// * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment)
    /// * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig)
    /// * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output)
    /// * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream)
    /// * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream)
    /// * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest)
    /// * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet)
    /// * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig)
    /// * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig)
    /// * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption)
    ///
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    ///
    /// If the mask is not present, then each field from the list above is updated
    /// if the field appears in the request payload. To unset a field, add the
    /// field to the update mask and remove it from the request payload.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The channel resource to be updated.
    pub channel: std::option::Option<crate::model::Channel>,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateChannelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateChannelRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateChannelRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [channel][crate::model::UpdateChannelRequest::channel].
    pub fn set_channel<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Channel>,
    {
        self.channel = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [channel][crate::model::UpdateChannelRequest::channel].
    pub fn set_or_clear_channel<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Channel>,
    {
        self.channel = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateChannelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateChannelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.UpdateChannelRequest"
    }
}

/// Request message for "LivestreamService.StartChannel".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartChannelRequest {
    /// Required. The name of the channel resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StartChannelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::StartChannelRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::StartChannelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for StartChannelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.StartChannelRequest"
    }
}

/// Request message for "LivestreamService.StopChannel".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StopChannelRequest {
    /// Required. The name of the channel resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StopChannelRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::StopChannelRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::StopChannelRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for StopChannelRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.StopChannelRequest"
    }
}

/// Request message for "LivestreamService.StartDistribution".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartDistributionRequest {
    /// Required. The name of the channel resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    /// Optional. A list of keys to identify the distribution configuration in the
    /// channel resource. If left empty, all the distributions in the channel
    /// specification will be started.
    pub distribution_keys: std::vec::Vec<std::string::String>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StartDistributionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::StartDistributionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [distribution_keys][crate::model::StartDistributionRequest::distribution_keys].
    pub fn set_distribution_keys<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.distribution_keys = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [request_id][crate::model::StartDistributionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for StartDistributionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.StartDistributionRequest"
    }
}

/// Request message for "LivestreamService.StopDistribution".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StopDistributionRequest {
    /// Required. The name of the channel resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub name: std::string::String,

    /// Optional. A list of key to identify the distribution configuration in the
    /// channel resource. If left empty, all the distributions in the channel
    /// specification will be stopped.
    pub distribution_keys: std::vec::Vec<std::string::String>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StopDistributionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::StopDistributionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [distribution_keys][crate::model::StopDistributionRequest::distribution_keys].
    pub fn set_distribution_keys<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.distribution_keys = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [request_id][crate::model::StopDistributionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for StopDistributionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.StopDistributionRequest"
    }
}

/// Request message for "LivestreamService.CreateInput".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInputRequest {
    /// Required. The parent location for the resource, in the form of:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. The input resource to be created.
    pub input: std::option::Option<crate::model::Input>,

    /// Required. The ID of the input resource to be created.
    ///
    /// This value must be 1-63 characters, begin and end with a lower-case letter
    /// or a number, and consist of only lower-case letters, numbers, and hyphens.
    /// In other words, it must match the following regex:
    /// `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
    pub input_id: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateInputRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateInputRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [input][crate::model::CreateInputRequest::input].
    pub fn set_input<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Input>,
    {
        self.input = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [input][crate::model::CreateInputRequest::input].
    pub fn set_or_clear_input<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Input>,
    {
        self.input = v.map(|x| x.into());
        self
    }

    /// Sets the value of [input_id][crate::model::CreateInputRequest::input_id].
    pub fn set_input_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.input_id = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::CreateInputRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateInputRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.CreateInputRequest"
    }
}

/// Request message for "LivestreamService.ListInputs".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInputsRequest {
    /// Required. The parent location for the resource, in the form of:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// The maximum number of items to return. If unspecified, server
    /// will pick an appropriate default. Server may return fewer items than
    /// requested. A caller should only rely on response's
    /// [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token]
    /// to determine if there are more items left to be queried.
    ///
    /// [google.cloud.video.livestream.v1.ListInputsResponse.next_page_token]: crate::model::ListInputsResponse::next_page_token
    pub page_size: i32,

    /// The next_page_token value returned from a previous List request, if any.
    pub page_token: std::string::String,

    /// The filter to apply to list results.
    pub filter: std::string::String,

    /// Specifies the ordering of results following syntax at [Sorting
    /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInputsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListInputsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListInputsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListInputsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListInputsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListInputsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListInputsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListInputsRequest"
    }
}

/// Response message for "LivestreamService.ListInputs".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInputsResponse {
    /// A list of inputs.
    pub inputs: std::vec::Vec<crate::model::Input>,

    /// Token to retrieve the next page of results, or empty if there are no more
    /// results in the list.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInputsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [inputs][crate::model::ListInputsResponse::inputs].
    pub fn set_inputs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Input>,
    {
        use std::iter::Iterator;
        self.inputs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListInputsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListInputsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListInputsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListInputsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListInputsResponse {
    type PageItem = crate::model::Input;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.inputs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for "LivestreamService.GetInput".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInputRequest {
    /// Required. The name of the input resource, in the form of:
    /// `projects/{project}/locations/{location}/inputs/{inputId}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetInputRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetInputRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetInputRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetInputRequest"
    }
}

/// Request message for "LivestreamService.DeleteInput".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInputRequest {
    /// Required. The name of the input resource, in the form of:
    /// `projects/{project}/locations/{location}/inputs/{inputId}`.
    pub name: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteInputRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteInputRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteInputRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteInputRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DeleteInputRequest"
    }
}

/// Request message for "LivestreamService.UpdateInput".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateInputRequest {
    /// Field mask is used to specify the fields to be overwritten in the Input
    /// resource by the update. You can only update the following fields:
    ///
    /// * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier)
    /// * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig)
    /// * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule)
    ///
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    ///
    /// If the mask is not present, then each field from the list above is updated
    /// if the field appears in the request payload. To unset a field, add the
    /// field to the update mask and remove it from the request payload.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The input resource to be updated.
    pub input: std::option::Option<crate::model::Input>,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateInputRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateInputRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateInputRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [input][crate::model::UpdateInputRequest::input].
    pub fn set_input<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Input>,
    {
        self.input = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [input][crate::model::UpdateInputRequest::input].
    pub fn set_or_clear_input<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Input>,
    {
        self.input = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateInputRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateInputRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.UpdateInputRequest"
    }
}

/// Request message for "LivestreamService.CreateEvent".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEventRequest {
    /// Required. The parent channel for the resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub parent: std::string::String,

    /// Required. The event resource to be created.
    pub event: std::option::Option<crate::model::Event>,

    /// Required. The ID of the event resource to be created.
    ///
    /// This value must be 1-63 characters, begin and end with a lower-case letter
    /// or a number, and consist of only lower-case letters, numbers, and hyphens.
    /// In other words, it must match the following regex:
    /// `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
    pub event_id: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateEventRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateEventRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [event][crate::model::CreateEventRequest::event].
    pub fn set_event<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Event>,
    {
        self.event = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [event][crate::model::CreateEventRequest::event].
    pub fn set_or_clear_event<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Event>,
    {
        self.event = v.map(|x| x.into());
        self
    }

    /// Sets the value of [event_id][crate::model::CreateEventRequest::event_id].
    pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.event_id = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::CreateEventRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateEventRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.CreateEventRequest"
    }
}

/// Request message for "LivestreamService.ListEvents".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEventsRequest {
    /// Required. The parent channel for the resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub parent: std::string::String,

    /// The maximum number of items to return. If unspecified, server
    /// will pick an appropriate default. Server may return fewer items than
    /// requested. A caller should only rely on response's
    /// [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token]
    /// to determine if there are more items left to be queried.
    ///
    /// [google.cloud.video.livestream.v1.ListEventsResponse.next_page_token]: crate::model::ListEventsResponse::next_page_token
    pub page_size: i32,

    /// The next_page_token value returned from a previous List request, if any.
    pub page_token: std::string::String,

    /// The filter to apply to list results.
    pub filter: std::string::String,

    /// Specifies the ordering of results following syntax at
    /// <https://cloud.google.com/apis/design/design_patterns#sorting_order>.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListEventsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListEventsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListEventsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListEventsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListEventsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListEventsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListEventsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListEventsRequest"
    }
}

/// Response message for "LivestreamService.ListEvents".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEventsResponse {
    /// A list of events.
    pub events: std::vec::Vec<crate::model::Event>,

    /// Token to retrieve the next page of results, or empty if there are no more
    /// results in the list.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListEventsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [events][crate::model::ListEventsResponse::events].
    pub fn set_events<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Event>,
    {
        use std::iter::Iterator;
        self.events = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListEventsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListEventsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListEventsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListEventsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListEventsResponse {
    type PageItem = crate::model::Event;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.events
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for "LivestreamService.GetEvent".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetEventRequest {
    /// Required. The name of the event resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetEventRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetEventRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetEventRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetEventRequest"
    }
}

/// Request message for "LivestreamService.DeleteEvent".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEventRequest {
    /// Required. The name of the event resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`.
    pub name: std::string::String,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteEventRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteEventRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteEventRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteEventRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DeleteEventRequest"
    }
}

/// Response message for Start/Stop Channel long-running operations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChannelOperationResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ChannelOperationResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ChannelOperationResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ChannelOperationResponse"
    }
}

/// Request message for "LivestreamService.ListClips".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClipsRequest {
    /// Required. Parent value for ListClipsRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListClipsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListClipsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListClipsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListClipsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListClipsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListClipsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListClipsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListClipsRequest"
    }
}

/// Response message for "LivestreamService.ListClips".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClipsResponse {
    /// The list of Clip
    pub clips: std::vec::Vec<crate::model::Clip>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListClipsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [clips][crate::model::ListClipsResponse::clips].
    pub fn set_clips<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Clip>,
    {
        use std::iter::Iterator;
        self.clips = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListClipsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListClipsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListClipsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListClipsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListClipsResponse {
    type PageItem = crate::model::Clip;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.clips
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for "LivestreamService.GetClip".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetClipRequest {
    /// Required. Name of the resource, in the following form:
    /// `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetClipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetClipRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetClipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetClipRequest"
    }
}

/// Request message for "LivestreamService.CreateClip".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateClipRequest {
    /// Required. The parent resource name, in the following form:
    /// `projects/{project}/locations/{location}/channels/{channel}`.
    pub parent: std::string::String,

    /// Required. The ID of the clip resource to be created.
    ///
    /// This value must be 1-63 characters, begin and end with a lower-case letter
    /// or a number, and consist of only lower-case letters, numbers, and hyphens.
    /// In other words, it must match the following regex:
    /// `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
    pub clip_id: std::string::String,

    /// Required. The resource being created
    pub clip: std::option::Option<crate::model::Clip>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateClipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateClipRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [clip_id][crate::model::CreateClipRequest::clip_id].
    pub fn set_clip_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.clip_id = v.into();
        self
    }

    /// Sets the value of [clip][crate::model::CreateClipRequest::clip].
    pub fn set_clip<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Clip>,
    {
        self.clip = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [clip][crate::model::CreateClipRequest::clip].
    pub fn set_or_clear_clip<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Clip>,
    {
        self.clip = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateClipRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateClipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.CreateClipRequest"
    }
}

/// Request message for "LivestreamService.DeleteClip".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteClipRequest {
    /// Required. The name of the clip resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteClipRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteClipRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteClipRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteClipRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DeleteClipRequest"
    }
}

/// Request message for "LivestreamService.ListDvrSessions".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDvrSessionsRequest {
    /// Required. Parent value for ListDvrSessionsRequest
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDvrSessionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDvrSessionsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDvrSessionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDvrSessionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDvrSessionsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListDvrSessionsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListDvrSessionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListDvrSessionsRequest"
    }
}

/// Response message for "LivestreamService.ListDvrSessions".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDvrSessionsResponse {
    /// The list of DVR sessions
    pub dvr_sessions: std::vec::Vec<crate::model::DvrSession>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDvrSessionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [dvr_sessions][crate::model::ListDvrSessionsResponse::dvr_sessions].
    pub fn set_dvr_sessions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DvrSession>,
    {
        use std::iter::Iterator;
        self.dvr_sessions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDvrSessionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListDvrSessionsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListDvrSessionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.ListDvrSessionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDvrSessionsResponse {
    type PageItem = crate::model::DvrSession;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.dvr_sessions
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for "LivestreamService.GetDvrSession".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDvrSessionRequest {
    /// Required. Name of the resource, in the following form:
    /// `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDvrSessionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDvrSessionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDvrSessionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetDvrSessionRequest"
    }
}

/// Request message for "LivestreamService.CreateDvrSession".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDvrSessionRequest {
    /// Required. The parent resource name, in the following form:
    /// `projects/{project}/locations/{location}/channels/{channelId}`.
    pub parent: std::string::String,

    /// Required. The ID of the DVR session resource to be created.
    ///
    /// This value must be 1-63 characters, begin and end with a lower-case letter
    /// or a number, and consist of only lower-case letters, numbers, and hyphens.
    /// In other words, it must match the following regex:
    /// `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
    pub dvr_session_id: std::string::String,

    /// Required. The resource being created
    pub dvr_session: std::option::Option<crate::model::DvrSession>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateDvrSessionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateDvrSessionRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [dvr_session_id][crate::model::CreateDvrSessionRequest::dvr_session_id].
    pub fn set_dvr_session_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.dvr_session_id = v.into();
        self
    }

    /// Sets the value of [dvr_session][crate::model::CreateDvrSessionRequest::dvr_session].
    pub fn set_dvr_session<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DvrSession>,
    {
        self.dvr_session = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dvr_session][crate::model::CreateDvrSessionRequest::dvr_session].
    pub fn set_or_clear_dvr_session<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DvrSession>,
    {
        self.dvr_session = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateDvrSessionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateDvrSessionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.CreateDvrSessionRequest"
    }
}

/// Request message for "LivestreamService.DeleteDvrSession".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDvrSessionRequest {
    /// Required. The name of the event resource, in the form of:
    /// `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteDvrSessionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteDvrSessionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteDvrSessionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteDvrSessionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.DeleteDvrSessionRequest"
    }
}

/// Request message for "LivestreamService.UpdateDvrSession".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDvrSessionRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// DvrSession resource by the update. You can only update the following
    /// fields:
    ///
    /// * `dvrWindows`
    ///
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The DVR session resource to be updated.
    pub dvr_session: std::option::Option<crate::model::DvrSession>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateDvrSessionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateDvrSessionRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateDvrSessionRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [dvr_session][crate::model::UpdateDvrSessionRequest::dvr_session].
    pub fn set_dvr_session<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DvrSession>,
    {
        self.dvr_session = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dvr_session][crate::model::UpdateDvrSessionRequest::dvr_session].
    pub fn set_or_clear_dvr_session<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DvrSession>,
    {
        self.dvr_session = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateDvrSessionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateDvrSessionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.UpdateDvrSessionRequest"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have
    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
    /// corresponding to `Code.CANCELLED`.
    ///
    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata"
    }
}

/// Request message for "LivestreamService.GetPool".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPoolRequest {
    /// Required. The name of the pool resource, in the form of:
    /// `projects/{project}/locations/{location}/pools/{poolId}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPoolRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPoolRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPoolRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.GetPoolRequest"
    }
}

/// Request message for "LivestreamService.UpdatePool".
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePoolRequest {
    /// Field mask is used to specify the fields to be overwritten in the Pool
    /// resource by the update. You can only update the following fields:
    ///
    /// * `networkConfig`
    ///
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The pool resource to be updated.
    pub pool: std::option::Option<crate::model::Pool>,

    /// A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server will know to ignore
    /// the request if it has already been completed. The server will guarantee
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request ID,
    /// the server can check if original operation with the same request ID was
    /// received, and if so, will ignore the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported `(00000000-0000-0000-0000-000000000000)`.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdatePoolRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdatePoolRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdatePoolRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [pool][crate::model::UpdatePoolRequest::pool].
    pub fn set_pool<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Pool>,
    {
        self.pool = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pool][crate::model::UpdatePoolRequest::pool].
    pub fn set_or_clear_pool<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Pool>,
    {
        self.pool = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdatePoolRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdatePoolRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.UpdatePoolRequest"
    }
}

/// Request message for "LivestreamService.PreviewInput"
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreviewInputRequest {
    /// Required. The name of the input resource, in the form of:
    /// `projects/{project}/locations/{location}/inputs/{inputId}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PreviewInputRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PreviewInputRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for PreviewInputRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.PreviewInputRequest"
    }
}

/// Response message for "LivestreamService.PreviewInput"
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreviewInputResponse {
    /// URI to display the preview content.
    pub uri: std::string::String,

    /// A bearer token used to authenticate connections that display the preview
    /// content. The token expires after one hour. For HTTP connections, this token
    /// should be included as a bearer token inside the Authorization header.
    pub bearer_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PreviewInputResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::PreviewInputResponse::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [bearer_token][crate::model::PreviewInputResponse::bearer_token].
    pub fn set_bearer_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bearer_token = v.into();
        self
    }
}

impl wkt::message::Message for PreviewInputResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.livestream.v1.PreviewInputResponse"
    }
}
